centos安装nodejs

1.下载安装nodejs

 wget http://nodejs.org/dist/v7.4.0/node-v7.4.0.tar.gz
yum install gcc openssl-devel gcc-c++ compat-gcc- compat-gcc--c++
tar -xf node-v7.4.0.tar.gz
cd node-v7.4.0
./configure --prefix=/usr/local/node
make && make install
ln -s /usr/local/node/bin/* /usr/sbin/

2.配置npm

 npm set prefix /usr/local
echo -e '\nexport PATH=/usr/local/lib/node_modules:$PATH' >> ~/.bashrc
source ~/.bashrc
上一篇:hexo 安装和部署


下一篇:腾讯云下安装 nodejs + 实现 Nginx 反向代理