2020-05-01Vue安装sass出错:npm ERR! [email protected] postinstall: `node scripts/build.js` npm ERR! Exi...

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

错误信息节选:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

然后项目就运行成功了。

你可能感兴趣的:(2020-05-01Vue安装sass出错:npm ERR! [email protected] postinstall: `node scripts/build.js` npm ERR! Exi...)