mongodb版本3.2,node安装的mongodb驱动模块版本为1.4.15,顺便问一句Failed to load c++ bson extension, using pure JS version,这个安了bson、node-gyp毫无效果= =
C:\Users\Administrator\blog>node app.js Failed to load c++ bson extension, using pure JS version Express server listening on port 3000 C:\Users\Administrator\blog\node_modules\connect-mongo\lib\connect-mongo.js:178 throw err; ^ Error: Error connecting to database: failed to connect to [localhost:27017] at null. (C:\Users\Administrator\blog\node_modules\connect-mongo\ node_modules\mongodb\lib\mongodb\connection\server.js:553:25) at emitThree (events.js:97:13) at emit (events.js:175:7) at null. (C:\Users\Administrator\blog\node_modules\connect-mongo\ node_modules\mongodb\lib\mongodb\connection\connection_pool.js:140:15) at emitTwo (events.js:87:13) at emit (events.js:172:7) at Socket. (C:\Users\Administrator\blog\node_modules\connect-mong o\node_modules\mongodb\lib\mongodb\connection\connection.js:512:10) at emitOne (events.js:77:13) at Socket.emit (events.js:169:7) at emitErrorNT (net.js:1250:8)
Finished. This bug can be divided into two parts. Failed to load c++ bson extension, using pure JS version. This part requires npm install node-gyp -g. Sometimes it can’t be installed, sometimes it can be installed in minutes;
Then You need to open the mongodb database, and open the command line path to the bin of mongodb
Manually set the project database path you want mongod.exe --dbpath c:datablog
Then in the project's package.json
Install these versions to the latest, otherwise you will still get an error
Start again and you’re done~~~