mongoDB报错Cannot find module '../build/Release/bson'
来源:互联网 发布:简述单片机的开发过程 编辑:程序博客网 时间:2024/05/19 10:40
打算用nodejs写一个blog系统,发现nodejs还是存在很多的坑。在使用mongodb时遇到如下报错问题:
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version
折腾了一番,最后是这样解决的:
找到 npm 的module mongodb ..node_modules\mongodb\node_modules\bson\ext\index.js
并并在catch块改变bson的js本版路径:
bson = require('../build/Release/bson');
变成
bson = require('../browser_build/bson');
如果发现连文件夹browser_biuild都没有的话(我的情况就是这样),直接复制文件:
..node_modules\bson\build\Release\bson
from
..node_modules\bson\browser_build\bson
2 0
- mongoDB报错Cannot find module '../build/Release/bson'
- mongoDB报错Cannot find module '../build/Release/bson'
- mongodb 报错 Error: Cannot find module '../build/Release/bson'解决办法
- nodeJs启动的时候:Error: Cannot find module '../build/Release/bson'的解决办法
- nodeJs启动的时候:Error: Cannot find module '../build/Release/bson'的解决办法
- Error: Cannot find module '../build/Release/canvas'
- nodejs报错:Cannot find module 'ejs'
- Node.js报错cannot find module
- webpack 报错Cannot find module 'opn'
- Cannot find module '../build/Debug/iconv.node
- nodejs express 启动报错:Error: Cannot find module 'xxx'
- 关于新版本react-native报错 :Cannot find module 'invariant'
- vue报错Error: Cannot find module 'ms'
- 安装vue项目启动报错Cannot find module
- 【Gulp】报错Cannot find module 'jshint/src/cli'
- VS2013 Cordova Build Error - cannot find module ./lib/plugin解决办法
- android 导入module,报failed to find build tools 错解决方案
- 用Intellij IDEA创建新项目的时候报错cannot find resource directory for module
- AndroidADT如何签名打包问题详解
- TCP/IP协议族-----1、引言
- 在静态HTML页面之间传值
- 黑马程序员---Java基础-多线程的实现
- 第十五周 阅读程序一(1)
- mongoDB报错Cannot find module '../build/Release/bson'
- openfire+spark+smack实现即时通讯
- Leetcode[63]-Unique Paths II
- Docker入门实战
- struggle in a slave school =>长期更新
- jquery鼠获取标滚轮次数(1)
- Java数据库连接池dbcp的用法
- 父亲节就快到了,为老爸接力一下好吗?
- HDU-1049-Climbing Worm(C++ && 编程初学者的题......)