Mac
在Mac下,如果你喜欢用homebrew,那么只用一行就可以装好:
brew install node
否则,只能考虑手工安装了,步骤如下:
- 安装Xcode
- 安装git
- 运行下面的命令行编译node.js
git clone git://github.com/joyent/node.git cd node ./configure make sudo make install
Ubuntu
- 安装依赖包
sudo apt-get install g++ curl libssl-dev apache2-utils sudo apt-get install git-core
- 运行下面的命令行:
git clone git://github.com/joyent/node.git cd node ./configure make sudo make install
- 安装依赖包
Windows
用cygwin来安装node,步骤如下:
- 安装cygwin
- 在cygwin的目录下,运行setup.exe安装下面列表中的包
- devel → openssl
- devel → g++-gcc
- devel → make
- python → python
- devel → git
- 运行cygwin
- 运行下面的命令行:
git clone git://github.com/joyent/node.git cd node ./configure make sudo make install
Centos
yum install gcc-c++ openssl-devel
wget --no-check-certificate https://github.com/joyent/node/tarball/v0.3.3
tar -xzvf ry-node-v0.3.3-0-g57544ba.tar.gz
cd ry-node-v0.3.3-0-g57544bac1
./configure
make
make install