尽管更改了文件Bson,但在npm安装中出现错误

编程入门 行业动态 更新时间:2024-10-10 10:22:46
本文介绍了尽管更改了文件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等模块需要 node-gyp 来编译Kim也讨论过的C/C ++代码. MSVC ++仅用于32位操作系统,现在,这是真正的问题,因为如果您已经安装了node.js和其他要求,例如具有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安装中出现错误

本文发布于:2023-11-02 07:22:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551735.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:但在   改了   出现错误   文件   Bson

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!