错误
输入npm install时,报错如下:
theme: orange
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@6.0.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@6.0.1 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\xxx\AppData\Roaming\npm-cache\_logs\2023-01-16T05_44_48_516Z-debug.log
原因
这个是因为sass安装时获取源的问题,修改sass安装的源,使用taobao的npm
解决方案
npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass
然后运行
npm install
关联错误
如果修改sass安装源之后,执行npm install仍然报以下错误:
则参考 此文章,取消ssl验证后,再修改一次sass安装的源,即可解决。