【发布时间】:2014-11-24 10:53:43
【问题描述】:
我目前在 Windows 7 上尝试安装 nodejs 和 npm 以与 git 和 yeoman 一起使用。我已经多次卸载 node 和 git 并不断收到相同的错误
`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.
Jeff@JEFF-PC ~
$ node --version
v0.10.32
Jeff@JEFF-PC ~
$ npm --version
1.4.28
Jeff@JEFF-PC ~
$ npm install --global yo
c:\UsersJeffnpm\yo -> c:\UsersJeffnpm\node_modules\yo\cli.js
> yo@1.2.1 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
我已经尝试过 yeoman 医生建议的命令,并尝试手动编辑环境变量并不断收到这些错误。我需要编辑我的 .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
如果我可以更改我的环境变量或编辑我的路径,请告诉我!非常感谢您的帮助!
【问题讨论】:
标签: node.js git npm yeoman git-bash