种一棵树最好的时间是10年前,其次就是现在,加油!
--by蜡笔小柯南
启动前端项目,使用 npm install
命令,出现以下错误:
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/fuse.js failed, reason: certificate has expired
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/fuse.js failed, reason: certificate has expired
意思是:淘宝镜像证书过期
使用命令查看当前配置的镜像源
npm config get registry
显示配置的镜像是:https://registry.npm.taobao.org/
由于使用的是淘宝镜像的旧域名,且HTTPS证书已过期,现在已经更换了新镜像地址
新地址是:https://registry.npmmirror.com
修改配置的镜像源,使用以下命令:
npm config set registry https://registry.npmmirror.com
修改完成后,查看是否修改成功
npm config get registry
显示的是修改后的镜像源地址,则说明修改成功