1. nodejs官网下载linux 64bit binary / source:
https://nodejs.org/en/download/current/
binary : wget https://nodejs.org/dist/v8.5.0/node-v8.5.0-linux-x64.tar.xz
source : wget https://nodejs.org/dist/v8.5.0/node-v8.5.0.tar.gz
2. source : tar -xvz -f node-v8.5.0.tar.gz
binary : tar -xvJ -f node*
3. binary :
cd node-v8.5.0-linux-x64/
node -v
PATH=$PATH:/root/node-v8.5.0-linux-x64/bin/
export PATH
source :
cd node-v8.5.0/
./configure
make
make install
注意:4核8GB的ECS编译node花了很久!以后坚决不要自己去编译node!
4. node -v
5. 安装GitHub项目whistle(比Fiddler和Charles更多增强功能),使用淘宝镜像加速。
npm install whistle -g --registry=https://registry.npm.taobao.org
执行显示结果:
/root/node-v8.5.0-linux-x64/bin/whistle -> /root/node-v8.5.0-linux-x64/lib/node_modules/whistle/bin/whistle.js
/root/node-v8.5.0-linux-x64/bin/wproxy -> /root/node-v8.5.0-linux-x64/lib/node_modules/whistle/bin/whistle.js
/root/node-v8.5.0-linux-x64/bin/w2 -> /root/node-v8.5.0-linux-x64/lib/node_modules/whistle/bin/whistle.js
+ whistle@1.5.14
added 127 packages in 7.545s
6. 默认配置启动whistle :
w2 start