Mongodb events.js:85
Mongodb events.js:85
我一直在做这个项目。我面临着一些问题,我无法解决后,我真的很努力。如果你们能帮我,我会很感激的。我试图连接到mongodb数据库使用node.js,但每当我启动服务器,我得到以下错误。我不知道如何解决这个错误。
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
The magic happens on port 8080
Connected correctly to server
events.js:85
throw er; // Unhandled 'error' event
^
Error: failed to connect to [undefined:27017]
at null.<anonymous> (C:UsersAdminDesktopAppslinked-up 0.0.1easy-node-authentication-masternode_modulesmongoosenode_modulesmongodblibmongodbconnectionserver.js:556:74)
at emit (events.js:118:17)
at null.<anonymous> (C:UsersAdminDesktopAppslinked-up 0.0.1easy-node-authentication-masternode_modulesmongoosenode_modulesmongodblibmongodbconnectionconnection_pool.js:156:15)
at emit (events.js:110:17)
at Socket.<anonymous> (C:UsersAdminDesktopAppslinked-up 0.0.1easy-node-authentication-masternode_modulesmongoosenode_modulesmongodblibmongodbconnectionconnection.js:534:10)
at Socket.emit (events.js:107:17)
at net.js:950:16
at process._tickCallback (node.js:355:11)
感谢您的宝贵时间和考虑
您确定在系统本地启动并运行mongodb吗?
要将本地路径映射到mongodb,请尝试以下命令
[location of mongodb]/bin/mongod——dbpath "specify location of database"
您是否像下面这样编写代码?
mongoose.connect(configDB.url); // connect to database
用您的db url设置它,如'localhost:27017/myDatabase'
相关文章:
- JS相等运算符(如===)是否可以使用embind类型
- 在 ubuntu 上安装 node js pulsar 客户端
- 如何在 Arduino 字符串的开头添加元素.类似于 JS unshift();
- Node.js fs.open() 在尝试打开 4 个以上的命名管道 (FIFO) 后挂起
- 如何在 Cheerp/js 中迭代动态命名的对象?
- 如何与 Cheerp/js 中的 extern 变量接口?
- 在 node.js 中将缓冲区从 C++ 转换为 UTF-8 字符串
- glfw 的基本设置会导致与 emscripten 生成的 js 文件中的事件侦听器有关的运行时错误
- 如何在C++中使用带有SFML的http reqest从节点.js服务器获取数据?
- 使用 Node.js N-API 调用 C 函数时,不会显示预期的输出
- 将数据从 OpenCV C++传递到 NodeJS/JS |电子
- C++ - 实现JS的setTimeout的现代方法
- 节点.js HTTP 无法通过套接字接收来自C++客户端的请求
- 如何使用 v8 本机插件将 C++ 数组交付到 Node.js
- 将二进制字符串/文件内容从 c++ 传递到节点 js
- 有没有类似的函数,比如 c++ 中的 JS Array.prototype.map?
- C++ 和 node.js 之间的 RSA 加密
- 从C++回调函数发出节点.js事件
- node.js Nan:在函数C++调用 JavaScript 回调
- Mongodb events.js:85