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

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

npm install mongodb
npm install bson
npm install assert

反复执行这三步安装,就不会有上面的问题了。

可用以下代码测试

var MongoClient = require('mongodb').MongoClient;
var assert = require('assert');


var url = 'mongodb://localhost:27017/test';
MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
console.log("Connected correctly to server.");
db.close();
});

posted @ 2015-12-22 14:58  次序  阅读(584)  评论(1编辑  收藏  举报