安装cnpm的坑

问题:

在终端输入:
npm i -g cnpm --registry=https://registry.npm.taobao.org

终端反馈:
`npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npm.taobao.org/cnpm failed, reason: unable to verify the first certificate

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersAdministratorAppDataRoaming pm-cache_logs2020-08-29T10_12_51_489Z-debug.log`

解决方案:

在终端输入:
npm config set strict-ssl false

再执行安装操作:
npm i -g cnpm --registry=https://registry.npm.taobao.org

稍等片刻。。。

在终端输入检测指令:
cnpm -v

终端反馈版本号,成功。。。

原文地址:https://www.cnblogs.com/SharkJiao/p/13583013.html