npm install 报错解决方案:
1.首先检查是否版本过低,全局更新版本,完成安装后可使用 npm - v 检查版本
- npm install -g npm
2.通过cnpm 命令行工具代替默认的 npm
- 全局下载淘宝cnmp:npm i cnpm -g
- 全局安装nrm:npm i nrm -g
- 查看已存在的镜像网站地址: nrm ls
- 切换为淘宝镜像源: nrm user taobao
3.清除软项缓存
- npm cache clean --forc
注意:如果不成功可执行安装
npm install -g cnpm --registry=https://registry.npm.taobao.org