我像这样安装了node.js:
cd /usr/local/bin/
git clone --depth 1 http://github.com/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 ~/.profile
然后我执行了这个curl http://npmjs.org/install.sh | sh
安装 npm。我注销并重新登录后,无法识别 npm 命令:
[/usr/local/bin/node]# npm install now
-bash: npm: command not found
我应该在 PATH 中添加什么才能让 npm 工作?
尝试这个:
git clone https://github.com/npm/cli
cd npm/cli
sudo make install
该建议来自https://github.com/isaacs/npm#readme https://github.com/isaacs/npm#readme.
它不像curl|sh那么可爱,但是很有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)