本文介绍了如何添加npm(node.js包管理器)到PATH?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我安装了node.js:
cd / usr / local / bin / git clone - -depth 1 github/joyent/node.git cd node git checkout origin / v0.4#optional。请注意,主站不稳定。 export JOBS = 2#可选,设置并行命令数。 mkdir〜/ local ./configure --prefix = $ HOME / local / node make make install echo'export PATH = $ HOME / local / node / bin:$ PATH'>> 〜/ .profile source〜/ .profilec> curl npmjs/install.sh | sh 以安装npm。退出并重新登录后,无法识别npm命令:
[/ usr / local / bin / node] #npm install now -bash:npm:command not found$ p <$ p $ p> git clone github/npm/npm.git cd npm sudo make install
此建议来自 https:// github/isaacs/npm#readme 。
它不像curl | sh一样可爱,但可以工作。
I installed node.js like this:
cd /usr/local/bin/ git clone --depth 1 github/joyent/node.git cd node git checkout origin/v0.4 # optional. Note that master is unstable. export JOBS=2 # optional, sets number of parallel commands. mkdir ~/local ./configure --prefix=$HOME/local/node make make install echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.profile source ~/.profileThen I executed this curl npmjs/install.sh | sh to install npm. After I logged out and logged back in, npm command wasn't recognized:
[/usr/local/bin/node]# npm install now -bash: npm: command not foundWhat should I add to the PATH to have npm working?
解决方案Try this:
git clone github/npm/npm.git cd npm sudo make installThat advice comes from of github/isaacs/npm#readme.
It is not as cute as curl|sh, but works.
更多推荐
如何添加npm(node.js包管理器)到PATH?
发布评论