npm install报错

时间:2024-04-02 10:45:39

fengbindeMacBook-Pro:ant-design-cloud fengbin$ npm install

npm ERR! code CERT_HAS_EXPIRED

npm ERR! errno CERT_HAS_EXPIRED

npm ERR! request to https://registry.npm.taobao.org/yorkie/download/yorkie-2.0.0.tgz failed, reason: certificate has expired

npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/fengbin/.npm/_logs/2024-03-16T01_33_34_155Z-debug.log

解决方案:

npm cache clean --force
npm config set strict-ssl false
npm install

-----npm配置------

vi /Users/fengbin/.npmrc

registry=https://registry.npmmirror.com/

disturl=https://npm.taobao.org/dist

strict-ssl=false