克隆项目 axios 的 NodeJS 问题

问题描述 投票:0回答:0

我是 NodeJS 的新手,我看了一个教程

https://www.youtube.com/watch?v=W1Kttu53qTg&list=LL&index=4&t=4969s

它的源代码来自这里

https://github.com/akashyap2013/CRUD_Application_Node

虽然我尝试按照它说的每一步去做:

在这个项目中,我们将使用 express 和 mongodb 创建节点 CRUD 应用程序。

运行这个项目克隆它并使用安装模块

npm install

然后创建 config.env 文件并创建 PORT 和 MONGO_URI 变量并指定值。 就是这样。你准备好了。要执行这个项目,只需输入

npm start

享受...!

我遇到一个问题是

{"message":"Request failed with status code 500","name":"Error","stack":"Error: Request failed with status code 500\n    at createError 
(C:\\Users\\Desktop\\NodeProject\\CRUD_Application_Node\\node_modules\\axios\\lib\\core\\createError.js:16:15)\n    
at settle (C:\\Users\\Desktop\\NodeProject\\CRUD_Application_Node\\node_modules\\axios\\lib\\core\\settle.js:17:12)\n    
at IncomingMessage.handleStreamEnd (C:\\Users\\Desktop\\NodeProject\\CRUD_Application_Node\\node_modules\\axios\\lib\\adapters\\http.js:244:11)\n    
at IncomingMessage.emit (node:events:525:35)\n    at endReadableNT (node:internal/streams/readable:1359:12)\n    
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)","config":{"url":"http://localhost:3000/api/users","method":"get","headers":{"Accept":"application/json, text/plain, */*","User-Agent":"axios/0.21.0"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1}}

谁能尝试克隆一下,看看你有没有和我一样的问题,以及如何解决。 谢谢

javascript node.js axios nodes http-status-code-500
© www.soinside.com 2019 - 2024. All rights reserved.