简体   繁体   中英

Can't install mongodb dependencies for nodejs (windows)

I'm trying to get a mongo database running with nodejs but when I type 'npm install mongodb' into my command line, I am getting the following error:

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>

It seems that bson0.1.3 is the issue. Does anyone know I might go about resolving this? I am using 64bit Windows 7, nodejs version 0.8.9, npm version 1.1.61 and have mongodb version 2.2.0 currently installed.

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

I've tried today and it worked fine for me the exact version of node and npm. Is there any info you can find in the npm-debug.log file?

Though note there is Issue created in the GitHub repository:
https://github.com/mongodb/js-bson/issues/14

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM