2012-09-25 28 views
0

我試圖讓蒙戈數據庫運行的NodeJS但是當我輸入「故宮安裝MongoDB的」進入我的命令行,我收到以下錯誤:無法爲的NodeJS(窗口)安裝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 [email protected] No README.md file found! 

    > [email protected] install C:\Users\me\node_modules\mongodb\node_modules\bson 
    > node install.js 

    CreateProcessW: The system cannot find the file specified. 
    npm ERR! [email protected] install: `node install.js` 
    npm ERR! `cmd "/c" "node install.js"` failed with 127 
    npm ERR! 
    npm ERR! Failed at the [email protected] 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版本。

回答

0

我今天試過,它對我的​​節點和npm的確切版本很好。 有沒有可以在npm-debug.log文件中找到的信息?

但要注意有在GitHub的信息庫中創建問題:需要NPM調用CreateProcessW
https://github.com/mongodb/js-bson/issues/14

+0

我在日誌中查看 - 一行說'無法執行exec安裝腳本'。我真的在這裏撓頭 - 我是否有可能在我的身上把事情搞砸了?我所做的所有事情都是從nodejs.org安裝nodejs(今天再試一次 - 現在在0.8.10版本上),下載了mongodb,然後將文件夾解壓到C:\,打開了cmd並在npm install mongodb中輸入。這是你做的嗎? – xdl

+0

我也試過指定安裝早期版本的依賴項,比如mongodb 0.9.x和mongodb 1.0.x,但總是bson(現在是0.0.4和0.0.5)拒絕安裝。 – xdl

+0

用-g(全局)和不用卸載mongodb - 確保bson被卸載(檢查'node list'和'node list -g') - 然後再次嘗試'node install monngodb' –

2

您的CMD的管理員權限。

+0

我認爲就是這樣。但要詳細說明,使用管理員權限啓動cmd將搜索cmd並右鍵單擊該圖標,然後選擇'以管理員身份運行'(或類似的方式)。 – UpTheCreek

+0

這並沒有幫助我。 – DrCord