【问题标题】:Npm dependency error - node-sass not installing ,throwing errorNpm 依赖错误 - node-sass 未安装,抛出错误
【发布时间】:2021-05-25 02:31:53
【问题描述】:

我使用节点版本 16.2.0 和 npm 版本 7.13,当我尝试在项目上运行 >npm install 时,出现以下情况,

npm ERR!code 1
npm ERR!path / Users / a.aashiq / Desktop / Projects / sdqui / node_modules / node - sass
npm ERR!command failed
npm ERR!command sh - c node - gyp rebuild ^
  npm ERR!1 error generated.
npm ERR!make: ** * [Release / obj.target / binding / src / binding.o] Error 1
npm ERR!gyp ERR!build error
npm ERR!gyp ERR!stack Error: `make`
failed with exit code: 2
npm ERR!gyp ERR!stack at ChildProcess.onExit(/Users/a.aashiq / Desktop / Projects / sdqui / node_modules / node - gyp / lib / build.js: 262: 23)
npm ERR!gyp ERR!stack at ChildProcess.emit(node: events: 365: 28)
npm ERR!gyp ERR!stack at Process.ChildProcess._handle.onexit(node: internal / child_process: 290: 12)
npm ERR!gyp ERR!System Darwin 20.4 .0
npm ERR!gyp ERR!command "/opt/homebrew/Cellar/node/16.2.0/bin/node"
"/Users/a.aashiq/Desktop/Projects/sdqui/node_modules/.bin/node-gyp"
"rebuild"
npm ERR!gyp ERR!cwd / Users / a.aashiq / Desktop / Projects / sdqui / node_modules / node - sass
npm ERR!gyp ERR!node - v v16 .2 .0
npm ERR!gyp ERR!node - gyp - v v3 .8 .0
npm ERR!gyp ERR!not ok

npm ERR!A complete log of this run can be found in:
  npm ERR!/Users/a.aashiq / .npm / _logs / 2021 - 05 - 25 T02_21_26_977Z - debug.log

我认为node-sass包和node或npm之间存在一些依赖冲突。我在package.json文件中使用node-sass包版本"node-sass": "^4.14.1",。它之前运行良好,我更新了我的mac,从然后它显示此错误。我通过 brew 安装了节点。如果它解决了,将会有很大的帮助。在此先感谢!

【问题讨论】:

    标签: npm package.json node-sass


    【解决方案1】:

    由于我使用 CRA 和最新 16.x 的节点版本(我的错误是我从 brew 安装的),发生了一些 deps 冲突,所以我从 brew 中卸载了节点并设法安装 LTS 节点 v 并重建了 sass 加载程序,它工作正常。谢谢

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-17
      • 2019-01-17
      • 2018-01-06
      • 2021-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多