尽管更改了文件Bson,但在npm安装中出现错误 [英] error in npm install inspite of changing the file Bson

查看:128
本文介绍了尽管更改了文件Bson,但在npm安装中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 7上使用mongodb3.0,node 0.12.0,npm 2.5.1集成时,我正在尝试向数据库中读取和写入数据,但是在npm intsall中出现此错误!

using mongodb3.0, node 0.12.0, npm 2.5.1 on windows 7 integrale, I am trying to read and write data into my database, but i have this error in npm intsall!

{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }

js-bson: Failed to load c++ bson extension, using pure JS version
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }

js-bson: Failed to load c++ bson extension, using pure JS version

我试图替换

bson = require('../build/Release/bson');

进入

bson = require('../browser_build/bson');

但是我有这样的错误:

 exports.BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0 TypeError: Cannot set property       'BSON_BINARY_SUBTYPE_DEFAULT' of undefined  

我正在使用和尚,而我已经运行了npm mongodb,npm和尚

i am using monk, anfd i have run npm mongodb, npm monk

推荐答案

问题:诸如Mongo-DB,Socket.io等模块需要具有64位版本的Python 2.7.3 ,那么您将面临与我一样的问题.

Problem: Modules like Mongo-DB, Socket.io and other requires node-gyp to compile C/C++ code which Kim also discussed. MSVC++ comes only for 32-bit OS, NOW this is the real problem because if you've install node.js and the other requirments like Python 2.7.3 with the 64-bit versions, then you'll face the problems like I did.

请按照以下步骤操作:

  • 卸载Node.js
  • 卸载所有模块,包括Python
  • 现在安装上述所有已卸载应用程序和平台的32位版本.
  • 执行所有必要步骤.
  • 现在安装要使用的模块.

您在安装时可能会看到一些错误,但不要惊慌.尝试运行您的应用程序,它将正常运行.

You may see some errors while installing, but don't panic. Try running your application and it will work just fine.

注意::此解决方案是特定于平台的,即适用于MS Windows.

NOTE: This solution is platform specific i.e. for MS Windows.

这篇关于尽管更改了文件Bson,但在npm安装中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆