CentOS7安装NodeJS
CentOS7安装NodeJS6.9
1.下载
wget https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.xz
2.解压
tar -xJf node-v6.9.2-linux-x64.tar.xz
3. 移到通用的软件安装目录 /opt/
mv node-v6.9.2-linux-x64 /opt/
4. 在系统命令中建立npm 和 node 命令的软连接
ln -s /opt/node-v6.9.2-linux-x64/bin/node /usr/local/bin/node
ln -s /opt/node-v6.9.2-linux-x64/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
5. 验证
node -v
npm -v
6. 安装Express
npm install -g express
7. 设置代理
npm config set registry "http://registry.npmjs.org/"
npm config set https-proxy http://username:pawword@server:port
npm config set proxy=http://192.168.1.1:8080
npm config set registry https://registry.npm.taobao.org
npm config delete proxy
npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/
npm config set msvs_version 2012 --global