linux安装git、node、pm2
一、安装Git
下载:# wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
解压:# tar -zxvf git-2.9.5.tar.gz
配置(安装路径):# ./configure
编译:# make
安装:# sudo make install
二、安装node (npm包含在node中)
下载:# wget http://cdn.npm.taobao.org/dist/node/v8.6.0/node-v8.6.0.tar.gz
解压:# tar -zxvf node-v8.6.0.tar.gz
配置(安装路径):# ./configure
编译:# make
安装:# sudo make install
三、安装cnpm
# npm install cnpm -g
四、安装pm2
# npm install pm2 -g
注:sudo npm 提示 command not found 的解决办法
sudo ln -s /usr/local/bin/node /usr/bin/node
sudo ln -s /usr/local/lib/node /usr/lib/node
sudo ln -s /usr/local/bin/npm /usr/bin/npm
sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf
注:安装Git报错
cache.h:21:18: warning: zlib.h: No such file or directory
缺少 zlib的头文件, 开发包没装,
yum install zlib (系统默认已经装上)
yum install zlib-devel
make[1]: *** [perl.mak] Error 2
make: *** [perl/perl.mak] Error 2
yum install perl-ExtUtils-MakeMaker package
注:安装node报错
make[1]: g++: Command not found
yum install gcc gcc-c++