最近几天我一直在跟踪教程(MERN堆栈),我的Web应用程序运行良好,但是由于某些原因,今天的终端在运行npm run dev时对着我qua叫,我不确定mongodb atlas现在还在连接吗?我没有为其更改配置文件,所以我不明白为什么最近几天完成配置后现在无法连接。
我不确定是nodejs还是mongodb,可以从下面的终端输出中找出问题所在吗?
我尝试再次安装节点模块,尝试使用一些终端命令来确保由于终端中的代理错误而导致所有内容都未在同一个localhost端口上运行……在这里,我的脑筋全死了!
dev-connector@1.0.0 dev /Users/bennking/Projects/dev-connector
> concurrently "npm run server" "npm run client"
[0]
[0] > dev-connector@1.0.0 server /Users/bennking/Projects/dev-connector
[0] > nodemon server
[0]
[1]
[1] > dev-connector@1.0.0 client /Users/bennking/Projects/dev-connector
[1] > npm start --prefix client
[1]
[1]
[1] > client@0.1.0 start /Users/bennking/Projects/dev-connector/client
[1] > react-scripts start
[1]
[0] [nodemon] 1.19.1
[0] [nodemon] to restart at any time, enter `rs`
[0] [nodemon] watching: *.*
[0] [nodemon] starting `node server.js`
[0] express-validator: requires to express-validator/check are deprecated.You should just use require("express-validator") instead.
[0] Server started on 5000
[0] failed to connect to server [cluster0-shard-00-01-klvgi.mongodb.net:27017] on first connect [MongoNetworkError: connection 5 to cluster0-shard-00-01-klvgi.mongodb.net:27017 closed]
[0] [nodemon] app crashed - waiting for file changes before starting...
[1] Starting the development server...
[1]
[1] Compiled with warnings.
[1]
[1] ./src/components/dashboard/Dashboard.js
[1] Line 1: 'Fragment' is defined but never used no-unused-vars
[1] Line 2: 'Link' is defined but never used no-unused-vars
[1] Line 10: React Hook useEffect has a missing dependency: 'getCurrentProfile'. Either include it or remove the dependency array. If 'getCurrentProfile' changes too often, find the parent component that defines it and wrap that definition in useCallback react-hooks/exhaustive-deps
[1]
[1] ./src/components/auth/Login.js
[1] Line 2: 'Link' is defined but never used no-unused-vars
[1]
[1] ./src/components/auth/Register.js
[1] Line 2: 'Link' is defined but never used no-unused-vars
[1]
[1] ./src/actions/profile.js
[1] Line 3: 'setAlert' is defined but never used no-unused-vars
[1]
[1] Search for the keywords to learn more about each warning.
[1] To ignore, add // eslint-disable-next-line to the line before.
[1]
[1] Proxy error: Could not proxy request /api/auth from localhost:3000 to http://localhost:5000.
[1] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).