记录【node-sass@4.14.1 安装失败】问题
·
报错日志:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
有效的解决文章引用:【解决node-sass@4.14.1 安装失败】
试过的方式:
1.改变全局本地源(X无效):
npm config set registry https://registry.npmmirror.com
2.切换各种版本的nodejs(X无效):
#查看nodejs版本列表
nvm list
#下载nodejs对应版本(比如:v14.20.0)
nvm install v14.20.0
#使用nodejs对应版本
nvm use v14.20.0
#删除nodejs对应版本
nvm uninstall v14.20.0
3.下载时临时指定二进制源和本地源(X无效):
npm install node-sass@4.14.1 --save-dev
--sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass/
--dist-url=https://registry.npmmirror.com/-/binary/node/
4.设置全局二进制源(√有效):
npm config set sass_binary_site=https://npmmirror.com/mirrors/node-sass
更多推荐

所有评论(0)