npm install 报错node-sass

npm install 报错[email protected] postinstall:`node scripts/build.js` Failed at the [email protected]

原因

这个是因为 sass 安装时获取源的问题,先修改 sass 安装的源,再运行npm install就成功了

解决办法

第一种方法

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

拷贝

第二种方法

先删除node-modules文件夹,删除 package-lock.json 文件

rm -rf node_modules
rm package-lock.json

拷贝

再使用淘宝镜像安装,使用--registry=https://registry.npm.taobao.org参数

npm install --registry=https://registry.npm.taobao.org

猜你喜欢

转载自blog.csdn.net/mao_mao37/article/details/128187731