天天看点

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@项目场景:问题描述:原因分析:解决方案:

你看到这里了?

node-sass已经弃用了,现在它已经被dart-sass所替代,dart-sass的安装更加稳定,去试试它吧.

项目场景:

使用node-sass设置Vue页面控件的样式,需要安装node-sass.

在安装[email protected] 时报错出现.

问题描述:

使用npm安装node-sass时报错:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
           

原因分析:

看大佬的分析说是sass安装时获取源的问题,需要修改sass安装的源.

解决方案:

这里修改成了了taobao的npm

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

重新安装,解决:

npm install
           

继续阅读