先安装 gcc-c++ 编译环境和 openssl,
>yum install gcc-c++ openssl-devel
>wget http://nodejs.org/dist/v0.12.0/node-v0.12.0.tar.gz (下载)
>tar -xvf node-v0.12.0.tar.gz (解压)
>cd node-v0.12.0
>./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
正文完