无法加载c ++ bson扩展名 [英] Failed to load c++ bson extension

查看:182
本文介绍了无法加载c ++ bson扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是一个总节点noob。我一直在尝试设置一个示例节点应用程序,但是每次尝试运行时,会出现以下错误:


节点应用




 无法加载c ++ bson扩展,使用纯JS版本

events.js:72
throw er; //未处理的'错误'事件
^
错误:无法连接到[#$%67890:27017]
在null。< anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:553:74)
在EventEmitter.emit(events.js:106:17 )
在null。< anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
在EventEmitter.emit(events.js:98:17 )
在Socket。< anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:512:10)
在Socket.EventEmitter.emit(events.js:95 :17)
at net.js:830:16
at process._tickCallback(node.js:415:13)


解决方案

我想你在安装mongodb库时没有使用make工具。我建议你做



xcode-select --install (在mac上)
sudo apt-get install gcc make build-essential (在ubuntu上)



并运行

  rm -rf node_modules 
npm缓存清理
npm安装

或只是基于@tobias注释的npm更新(安装build-essential后)

  npm update 


A total node noob here. I've been trying to set up a sample node app but the following error keeps popping up every time I try to run:

node app

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

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: failed to connect to [#$%67890 :27017]
    at null.<anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:553:74)
    at EventEmitter.emit (events.js:106:17)
    at null.<anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
    at EventEmitter.emit (events.js:98:17)
    at Socket.<anonymous> (/home/thejazeto/code/nodejs/authen/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:512:10)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:830:16
    at process._tickCallback (node.js:415:13)

解决方案

I guess you did not have the make tools available when you installed your mongodb library. I suggest you do

xcode-select --install (on a mac) or sudo apt-get install gcc make build-essential (on ubuntu)

and run

rm -rf node_modules
npm cache clean
npm install

OR just npm update based on @tobias comment (after installing build-essential)

npm update

这篇关于无法加载c ++ bson扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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