2012-02-20 33 views
2

我無法使用npm安裝mongodb和mongoose。任何意見將不勝感激!我看到他們說清除緩存和更新的早期帖子 - 這已完成,但仍然是同樣的問題...下面是mongo db安裝的錯誤,但它幾乎完全相同的貓鼬無法讓Mongo DB在Windows 7上使用npm設置...任何想法?

各種獲得服務器日誌...

> [email protected] install C:\Users\petrov\Desktop\nodejs\node_modules\mongodb 
> node install.js 

'node' is not recognized as an internal or external command, 
operable program or batch file. 
npm ERR! error installing [email protected] 

npm ERR! [email protected] install: `node install.js` 
npm ERR! `cmd "/c" "node install.js"` failed with 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script. 
npm ERR! This is most likely a problem with the mongodb 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 mongodb 
npm ERR! There is likely additional logging output above. 
npm ERR! 
npm ERR! System Windows_NT 6.1.7601 
npm ERR! command "C:\\Users\\petrov\\Desktop\\nodejs\\\\node.exe" 
"C:\\Users\\petrov\\Desktop\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "mongodb" 
npm ERR! cwd C:\Users\petrov\Desktop\nodejs 
npm ERR! node -v v0.6.10 
npm ERR! npm -v 1.1.0-3 
npm ERR! code ELIFECYCLE 
npm ERR! message [email protected] install: `node install.js` 
npm ERR! message `cmd "/c" "node install.js"` failed with 1 
npm ERR! errno {} 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  C:\Users\petrov\Desktop\nodejs\npm-debug.log 
npm not ok 

回答

3

檢查安裝節點的路徑或從安裝節點的同一目錄運行命令。

+0

謝謝!我從一開始就從節點安裝目錄運行命令... – Petrov 2012-02-21 10:58:12

+1

確保節點在你的windows路徑中,因爲我認爲npm彈出,所以如果它不在PATH中,它將無法找到它。 – christkv 2012-02-23 11:49:45

2

嘗試NPM -DD安裝MongoDB的

它可能爲你工作。在npm中似乎有一個錯誤

+0

感謝您的諮詢!嘗試過,但仍然存在相同的問題 - 看起來安裝腳本在從shell內部調用'node install.js'時總是出錯。它說'節點'不被識別。 – Petrov 2012-02-21 10:56:20

1

對於那些仍然遇到這個問題,我解決了它通過添加nodejs安裝路徑(我C:\Program Files (x86)\nodejs\)到我的本地PATH環境變量。