【nodejs】linux下安装nodejs

准备命令

centos

1
yum -y install gcc make gcc-c++ openssl-devel wget

ubuntu

1
apt-get install python gcc make g++

下载源码以及解压

1
2
wget https://nodejs.org/dist/v6.10.2/node-v6.10.2.tar.gz
tar -zvxf node-v6.10.2.tar.gz

配置和编译

1
2
3
cd node-v6.10.2
./configure
make

安装

1
make install

验证node安装是否成功

1
node -v