切换 npm 源

切换至npmmirror镜像

npm config set registry https://registry.npmmirror.com

清除 npm 缓存

强制清除 npm 的本地缓存,然后再重新安装依赖,解决因缓存导致的证书验证问题

npm cache clean --force

更新 npm

将 npm 更新到最新版本,然后再尝试安装

npm install -g npm
最后修改:2025 年 09 月 21 日
如果觉得我的文章对你有用,请随意赞赏