找不到模块'../build/Release/bson'] code:“MODULE_NOT_FOUND'} JS-​​BSON:无法加载C ++ BSON扩展,采用纯JS版 [英] Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version

查看:1609
本文介绍了找不到模块'../build/Release/bson'] code:“MODULE_NOT_FOUND'} JS-​​BSON:无法加载C ++ BSON扩展,采用纯JS版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误:

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

下面是我的版本的详细信息:

Here are my version details:

操作系统:Windows 7

OS: Windows 7

MongoDB的:2.6.5

MongoDB: 2.6.5

节点:0.12.0

在我张贴的问题,在这里我都试过这些东西。

I have tried these things before I posted the issue here.


  1. 我去到\\节点模块\\猫鼬\\节点模块\\ MongoDB的\\节点模块\\ BSON文件夹,并在绑定石膏文件下的变化做出
    从include_dirs':'


  2. 运行此命令故宫安装-g节点石膏

  1. I went to \node-modules\mongoose\node-modules\mongodb\node-modules\bson folder and made below change in the binding-gyp file from 'include_dirs': [ '

  2. Ran this command npm install -g node-gyp

我已经更新了猫鼬版21年8月3日内部的package.json

I've updated the mongoose version to 3.8.21 inside package.json

没有什么工作。请建议

推荐答案

找到NPM模块的MongoDB ..node_modules \\ MongoDB的\\ node_modules \\ BSON \\分机\\ index.js

find in npm module mongodb ..node_modules\mongodb\node_modules\bson\ext\index.js

和在catch块的变化路径,js版

and change path to js version in catch block

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

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

或者复制文件

.. node_modules \\ BSON \\建立\\发布\\ BSON

..node_modules\bson\build\Release\bson

.. node_modules \\ BSON \\ browser_build \\ BSON

..node_modules\bson\browser_build\bson

这篇关于找不到模块'../build/Release/bson'] code:“MODULE_NOT_FOUND'} JS-​​BSON:无法加载C ++ BSON扩展,采用纯JS版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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