2014-09-29 31 views
0

我目前在Windows 7上試圖安裝nodejs和npm以與git和yeoman一起使用。我已經卸載多次節點和Git和繼續得到同樣的錯誤爲什麼安裝yeoman時,我一直在使用NodeJs和npm出錯?

`Welcome to Git (version 1.9.4-preview20140815) 


Run 'git help git' to display the help index. 
Run 'git help <command>' to display help for specific commands. 

[email protected] ~ 
$ node --version 
v0.10.32 

[email protected] ~ 
$ npm --version 
1.4.28 

[email protected] ~ 
$ npm install --global yo 
c:\UsersJeffnpm\yo -> c:\UsersJeffnpm\node_modules\yo\cli.js 

> [email protected] postinstall c:\UsersJeffnpm\node_modules\yo 
> node ./scripts/doctor 

[Yeoman Doctor] Uh oh, I found potential errors on your machine 
--------------- 

[Error] npm root value is not in your NODE_PATH 
    [info] 
    NODE_PATH = :\Users\Jeff\npm\node_modules:\home\npm\lib\node_modules 
    npm root = c:\UsersJeffnpm\node_modules 

    [Fix] Append the npm root value to your NODE_PATH variable 
    If you're using cmd.exe, run this command to fix the issue: 
     setx NODE_PATH "%NODE_PATH%;c:\UsersJeffnpm\node_modules" 
    Then restart your command line. Otherwise, you can setup NODE_PATH manually: 

     https://github.com/sindresorhus/guides/blob/master/set-environment-variabl 
es.md#windows 

我已經試過了自耕農醫生建議,並試圖手動編輯環境變量,並不斷收到這些錯誤的命令。我需要編輯我的.bashrc或.gitconfig文件嗎?

這裏是我的.bashrc內容:

export PATH=$PATH:/usr/local/bin 
export NODE_PATH=:/Users/Jeff/npm/node_modules 
export NODE_PATH=:/Users/Jeff/npm/node_modules:/home//npm/lib/node_modules 

如果我可以改變我的環境變量或修改路徑,請讓我知道!我非常感謝您的幫助!

回答

0

.bashrc的第二行中,您會注意到您有/home//npm/lib/node_modules。根據該文件中的其他項目,我打賭它應該是/Users/Jeff/npm/lib/node_modules或類似的。