4 description: 服务器端JavaScript
\r
5 navigation: [1.安装, 2.HelloWorld]
\r
6 update: 2013-02-22 16:21
\r
10 <div class="page-header">
\r
14 <h4><small>1.1</small> -ubuntu 12.10 x32-</h4>
\r
16 $ sudo add-apt-repository ppa:chris-lea/node.js
\r
17 $ sudo apt-get update
\r
18 $ sudo apt-get install nodejs npm # npm为Nodejs的包管理器
\r
21 <h4><small>1.2</small> -OS X-</h4>
\r
24 add /usr/local/share/npm/bin to $PATH
\r
27 <h4><small>1.3</small> nvm</h4>
\r
29 $ curl https://raw.github.com/creationix/nvm/master/install.sh | sh
\r
36 <div class="page-header">
\r
37 <h3>二、Hello World</h3>
\r
40 $ echo "console.log('Hello World!!');" > hello-world.js
\r
41 $ node hello-world.js
\r