essay-org / essay

personalise blog system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

编译通过,访问出错

longyangsky opened this issue · comments

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

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

commented

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

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

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

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

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

commented

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