目录
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/vue-loader failed, reason: certificate has expirednpm ERR! A complete log of this run can be found in:
npm ERR! D:\Environment\nvm\node_cache\_logs\2024-01-22T04_34_51_215Z-debug.log
原因:
CERT_HAS_EXPIRED是一个由Node.js和npm抛出的错误,表示你正在尝试访问的服务器的SSL证书已经过期。
解决方法:
清除npm缓存
npm cache clean --force
取消ssl验证:
npm config set strict-ssl false
之后再npm install 你想安装的东西
再不行的话试试更换npm镜像源:
npm config set registry http://registry.cnpmjs.org
npm config set registry http://registry.npm.taobao.org
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path D:\Git\.npmrc
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'D:\Git\.npmrc'
npm ERR! [Error: EPERM: operation not permitted, open 'D:\Git\.npmrc'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'D:\\Git\\.npmrc'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.