`npm install mongodb` raises an error

I'm just trying to find out mongodb, when I try to install mongodb for node, I got an error like below.

By the way, my environment: ubuntu 10.04

+ node v0.6.9

. Also I use nvm which change node version locally.

zhkzyth@geek:~/codeRep/Nodejs---MongoDB$ npm install mongodb
npm http GET https://registry.npmjs.org/mongodb
npm http 304 https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/bson/0.1.5
npm http 304 https://registry.npmjs.org/bson/0.1.5

> bson@0.1.5 install /home/zhkzyth/codeRep/Nodejs---MongoDB/node_modules/mongodb/node_modules/bson
> node install.js || (exit 0)

================================================================================
=                                                                              =
=  Attempting to build bson c++ extension                                      =
=   Windows: no build will be attempted as binaries are prepackaged            =
=   Unix: on failure the package will still install without the C++ extension  =
=                                                                              =
================================================================================
node-gyp clean
gyp ERR! clean error 
gyp ERR! stack Error: UNKNOWN, unknown error 'build'
gyp ERR! System Linux 2.6.32-45-generic
gyp ERR! command "node" "/usr/local/bin/node-gyp" "clean"
gyp ERR! cwd /home/zhkzyth/codeRep/Nodejs---MongoDB/node_modules/mongodb/node_modules/bson
gyp ERR! node -v v0.6.9
gyp ERR! node-gyp -v v0.8.3
gyp ERR! not ok 
make: *** [clean] 错误 1
child process exited with code 2
mongodb@1.2.8 ./node_modules/mongodb 
└── bson@0.1.5

      

+3


source to share


1 answer


I don't believe you can install it on Node.js versions earlier than 0.6.19. This issue was raised on the mongodb github issue page and has been updated to failure due to Node switching to using gyp to build the extension.



+1


source







All Articles