我只是尝试学习mongodb,当我尝试安装mongodb for node时,我得到了如下所示的错误。
顺便说一下,我的环境:ubuntu 10.04+ node v0.6.9.Also我使用nvm,它在本地切换节点版本。
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发布于 2013-03-05 20:03:30
我不相信你能在0.6.19之前的Node.js版本上安装它。此issue是在mongodb github问题页面上提出的,并且由于节点切换到使用gyp构建扩展而升级失败。
https://stackoverflow.com/questions/14645474
复制相似问题