一、
从svn拉取下项目后,依赖包一直安装失败,报错如下
尝试的解决办法:
1 去C:\user 删除 .npmrc文件
2 删除项目文件夹里的node_module
3 清除一下npm的缓存,再重新安装依赖
npm cache clean --force
npm install
还是没成功 注:有的博主成功不报错
我又尝试着降低了下node版本 ,从node16 降到 14.17.6
成功了,执行npm install即可
二、node-sass安装失败
原因:node和node-sass8.0.0版本不匹配,降低node版本到 14.18
重新安装 node-sass仍然报错,切换到淘宝源,成功
三、报错:Failed at the cwebp-bin@6.1.2 postinstall script
解决方式:
npm i --registry https://registry.npm.taobao.org --ignore-scripts
–registry https://registry.npm.taobao.org 修改npm的registry为淘宝镜像
–ignore-scripts 表示npm将不会运行在package.json中指定的scripts脚本。