先安装gcc-c++编译环境和openssl,
>yum install gcc-c++ openssl-devel
>wget http://nodejs.org/dist/v0.10.4/node-v0.10.4.tar.gz (下载)
>tar –xvf node-v0.10.4.tar.gz (解压)
>cd node-v0.4.8
>./configure (查看配置是否完整,如果显示如下,则证明环境充分)
- Checking for program g++ or c++ : /usr/bin/g++
- Checking for program cpp : /usr/bin/cpp
- Checking for program ar : /usr/bin/ar
- Checking for program ranlib : /usr/bin/ranlib
- Checking for g++ : ok
- Checking for program gcc or cc : /usr/bin/gcc
- Checking for gcc : ok
- Checking for library dl : yes
- Checking for openssl : yes
- Checking for library util : yes
- Checking for library rt : yes
- Checking for fdatasync(2) with c++ : yes
- 'configure' finished successfully (0.405s)
>make;make install (编译生成node)
>cp -f node /usr/bin/node (将node复制到全局环境)
安装npm
>curl https://npmjs.org/install.sh | sh
安装express
>npm install express -g