安装淘宝cnpm

npm install -g cnpm –registry=https://registry.npm.taobao.org
[root@localhost ~]# npm install cnpm -g –registry=https://registry.npm.taobao.org
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
/usr/local/src/node-v10.13.0-linux-x64/bin/cnpm -> /usr/local/src/node-v10.13.0-linux-x64/lib/node_modules/cnpm/bin/cnpm
+ cnpm@6.0.0
updated 1 package in 115.51s

cnpm -v 未找到命令

bash: cnpm: 未找到命令…

解决:建软链接

ln -s /usr/local/src/node-v10.13.0-linux-x64/bin/cnpm /usr/local/bin/cnpm

显示如下

[root@localhost ~]# cnpm -v
cnpm@6.0.0 (/usr/local/src/node-v10.13.0-linux-x64/lib/node_modules/cnpm/lib/parse_argv.js)
npm@6.9.0 (/usr/local/src/node-v10.13.0-linux-x64/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
node@10.13.0 (/usr/local/src/node-v10.13.0-linux-x64/bin/node)
npminstall@3.20.2 (/usr/local/src/node-v10.13.0-linux-x64/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/usr/local/src/node-v10.13.0-linux-x64
linux x64 3.10.0-957.el7.x86_64
registry=https://registry.npm.taobao.org