错误
[root@xxxx devtools]# npm install -g vuepress --no-check-certificate
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/vuepress failed, reason: certificate has expired
解决方案
根据错误原因能够看出npm install执行的是https协议,因此需要通过数字证书来保证的。因此简单的方法就是取消ssl验证:npm config set strict-ssl false 我是通过更换npm镜像源,如下:
[root@xxx devtools]# npm config set registry http://registry.npm.taobao.org