2020-05-01Vue安装sass出错:npm ERR! node-sass@4.14.0 postinstall: `node scripts/build.js` npm ERR! Exi...

vue项目换台电脑安装node-sass出错:

错误信息节选:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-05-01T14_42_18_169Z-debug.log

解决方法:

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

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

重新安装:

npm install   node-sass

然后项目就运行成功了。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。