sudo apt-get install python-software-properties sudo add-apt-repository ppa:jerome-etienne/neoip sudo apt-get update sudo apt-get install nodejs 如上是一种,更新下node包到最新版本。
我选择了第二种: 参考: http://wenku.baidu.com/link?url=MoHzDNKMUX9P5fkfe5KlDnSNbSM8NnlA4CSCoKV5fQo9Oi1YbOGW1q4yHx7uLjazov5k1GbwrYDBN-wbYmApBNJYli49PXER2YN8c4OGOhe 然后设置 环境变量: ./configure –prefix=$HOME/local/node make make install echo ‘export PATH=/usr/local/node/bin:$PATH’ >> ~/.profile echo ‘export NODE_PATH=/usr/local/node:/usr/local/node/lib/node_modules’ >> ~/.profile source ~/.profile
4 回复
@youarenode https://github.com/creationix/nvm 把下面这个加到.bashrc里面
export NVM_DIR="/home/ubuntu/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
nvm use 0.12