Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译通过,访问出错 #35

Closed
longyangsky opened this issue Dec 24, 2018 · 5 comments
Closed

编译通过,访问出错 #35

longyangsky opened this issue Dec 24, 2018 · 5 comments

Comments

@longyangsky
Copy link

database connect successed
(node:796) UnhandledPromiseRejectionWarning: MongoError: command find requires authentication
at queryCallback (E:\nodejs_Study\essay\node_modules\mongodb-core\lib\cursor.js:248:25)
at E:\nodejs_Study\essay\node_modules\mongodb-core\lib\connection\pool.js:532:18
at process._tickCallback (internal/process/next_tick.js:61:11)
(node:796) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:796) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

访问
http://127.0.0.1:3000/
错误
TypeError
Cannot read property 'nickname' of undefined

@hsiangleev
Copy link

@longyangsky 同样的错误,请问有解决办法吗

@wmui
Copy link
Collaborator

wmui commented Dec 25, 2018

建议mongodb 4.0 以上,node 8.12.0以上运行

@longyangsky
Copy link
Author

@longyangsky 同样的错误,请问有解决办法吗

实际连MOGODB的代码里没有带用户名和密码
在server/modle 的index.js的第10行带用户名和密码 加上用户名和密码就OK了。
问下。如何在修改SERVER后端服务文件时候,不让自动编译整个项目

@longyangsky
Copy link
Author

建议mongodb 4.0 以上,node 8.12.0以上运行

谢谢了。可以了。MOGODB连接代码没用带用户名和密码,在修改SERVER服务文件夹下的任何代码。都会重新编译整个项目,而不是像修改.VUE文件只会编译新加的。这个问题怎么解决啊。大神

@wmui
Copy link
Collaborator

wmui commented Dec 26, 2018

@longyangsky package.json 去掉 dev 的 nodemon配置 cross-env NODE_ENV= development node server/index.js

@wmui wmui closed this as completed Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants