admin管理员组文章数量:1640975
接上文在执行报错
npm cache clean --force
npm WARN using --force Recommended protections disabled.
1.检查版本
查看node.js、npm、vue、vue脚手架、npm镜像
【node版本】
命令:node -v
结果:v18.15.0 (我目前使用的版本)
【npm版本】
命令:npm -v
结果:9.5.0
【cnpm版本】
命令:cnpm -v
结果:cnpm@7.6.0
【npm映射网址(镜像网址)】
命令:npm config get registry
结果:https://registry.npmjs/ (我这里是官方默认镜像)
【vue脚手架版本】
命令:vue -V
结果:
@vue/cli 5.0.8
2.安装版本
【安装指定版本的vue,需要卸载最新版本的vue】
npm uninstall -g @vue/cli
例如【安装指定的vue版本脚手架】
npm install -g @vue/cli@4.5.6
【安装指定的vue版本】
npm install vue@2.x.x
查看镜像源配置
1.查看当前使用的镜像地址:
npm config get registry
2.官方默认全局镜像
https://registry.npmjs
3.设置镜像源(淘宝镜像):
npm config set registry https://registry.npm.taobao
4.官方默认全局镜像
https://registry.npmjs
补充常用镜像源:
npm 官方原始镜像网址是:https://registry.npmjs/
淘宝 NPM 镜像:http://registry.npmmirror
阿里云 NPM 镜像:https://npm.aliyun
腾讯云 NPM 镜像:https://mirrors.cloud.tencent/npm/
华为云 NPM 镜像:https://mirrors.huaweicloud/repository/npm/
网易 NPM 镜像:https://mirrors.163/npm/
中国科学技术大学开源镜像站:http://mirrors.ustc.edu/
清华大学开源镜像站:https://mirrors.tuna.tsinghua.edu/
腾讯,华为,阿里的镜像站基本上比较全
建议用国内的镜像。
本文标签: 报错WARNnpminstallprotections
版权声明:本文标题:npm install报错,解决记录:npm WARN using --force Recommended protections disabled. 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1729316840a1195393.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论