最近装npm包总是遇到node-sass报错问题

问题:npm install 遇到下面的问题

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.12.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.12.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  1. 删了node_modules和package-lock.json
  2. 清理了cache重装 (npm cache clear --force),
  3. 重装最后还是失败


后来看了下是node的版本不对

我用的是node 14的版本,node-sass却还是12,所以,我把package.json的node-sass也改成14,然后再安装就成功了

以下是node-sass和node的版本关系

相关标签:
  • node-sass报错
  • 解决node-sass
1人点赞

发表评论

当前游客模式,请登陆发言

所有评论(0)