无法为nodejs(windows)安装mongodb依赖项

时间:2012-09-25 13:41:39

标签: windows node.js mongodb

我正在尝试使用nodejs运行mongo数据库但是当我在命令行中输入'npm install mongodb'时,我收到以下错误:


    C:\Users\me>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.3
    npm http 304 https://registry.npmjs.org/bson/0.1.3
    npm WARN package.json bson@0.1.3 No README.md file found!

    > bson@0.1.3 install C:\Users\me\node_modules\mongodb\node_modules\bson
    > node install.js

    CreateProcessW: The system cannot find the file specified.
    npm ERR! bson@0.1.3 install: `node install.js`
    npm ERR! `cmd "/c" "node install.js"` failed with 127
    npm ERR!
    npm ERR! Failed at the bson@0.1.3 install script.
    npm ERR! This is most likely a problem with the bson package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     node install.js
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls bson
    npm ERR! There is likely additional logging output above.

    npm ERR! System Windows_NT 6.1.7601
    npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_m
    odules\\npm\\bin\\npm-cli.js" "install" "mongodb"
    npm ERR! cwd C:\Users\me
    npm ERR! node -v v0.8.9
    npm ERR! npm -v 1.1.61
    npm ERR! code ELIFECYCLE
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR!     C:\Users\me\npm-debug.log
    npm ERR! not ok code 0

    C:\Users\me>

 

似乎bson0.1.3是个问题。有谁知道我可能会解决这个问题?我使用64位Windows 7,nodejs版本0.8.9,npm版本1.1.61并且当前安装了mongodb 2.2.0版。

2 个答案:

答案 0 :(得分:2)

npm需要管理员权限才能调用CreateProcessW。

答案 1 :(得分:0)

我今天尝试过,它对我来说很好,节点和npm的确切版本。 您可以在npm-debug.log文件中找到任何信息吗?

虽然注意在GitHub存储库中创建了问题:
https://github.com/mongodb/js-bson/issues/14