Linux(CentOS7.2)安装cnpm

1、安装cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

2、如下安装成功

/root/node-v10.16.3-linux-x64/bin/cnpm -> /root/node-v10.16.3-linux-x64/lib/node_modules/cnpm/bin/cnpm
+ [email protected]
added 686 packages from 950 contributors in 17.057s

3、测试是否安装成功

cnpm -v

4、如果出现这样证明需要设置软引

-bash: cnpm: command not found

5、设置软引

ln -s /root/node-v10.16.3-linux-x64/bin/cnpm /usr/local/bin/cnpm
#OR
ln -sf /root/node-v10.16.3-linux-x64/bin/cnpm /usr/local/bin/cnpm

6、再次cnpm -v测试,如下表示成功

[email protected] (/root/node-v10.16.3-linux-x64/lib/node_modules/cnpm/lib/parse_argv.js)
[email protected] (/root/node-v10.16.3-linux-x64/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
[email protected] (/root/node-v10.16.3-linux-x64/bin/node)
[email protected] (/root/node-v10.16.3-linux-x64/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/root/node-v10.16.3-linux-x64 
linux x64 3.10.0-957.21.3.el7.x86_64 
registry=https://r.npm.taobao.org

你可能感兴趣的:(Linux(CentOS7.2)安装cnpm)