我像这样安装了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 正常工作?