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

然后项目就运行成功了。


Kason
209 声望6 粉丝