$ sudo add-apt-repository ppa:chris-lea/node.js $ sudo apt-get update $ sudo apt-get install nodejs npm # npm为Nodejs的包管理器
$ brew install node add /usr/local/share/npm/bin to $PATH
$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh $ nvm ls $ nvm install 0.8
$ echo "console.log('Hello World!!');" > hello-world.js $ node hello-world.js