【问题标题】:I cannot install node module 'node-sass' with yarn@1.22.10我无法使用 yarn@1.22.10 安装节点模块“node-sass”
【发布时间】:2021-08-03 14:56:36
【问题描述】:

我正在用element-ui写一个vue 2项目,我需要安装node-sass模块但是不管我安装哪个版本,都失败了。我的电脑运行的是 macOS 11.4,如何才能成功安装 node-sass? webpack 版本为 4.46.0。

% yarn add node-sass@4

...

1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/xxx/Workspace/web/h5/vue-demo/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 20.6.0
gyp ERR! command "/usr/local/Cellar/node/16.4.0/bin/node" "/Users/xxx/Workspace/web/h5/vue-demo/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/vorbote/Workspace/web/h5/vue-demo/node_modules/node-sass
gyp ERR! node -v v16.4.0

【问题讨论】:

    标签: vuejs2 npm-install node-sass


    【解决方案1】:

    尝试删除 package-lock.json 并再次运行 npm install

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 2014-11-19
        • 2021-11-16
        • 2022-12-31
        • 2017-11-07
        • 1970-01-01
        • 2018-03-29
        相关资源
        最近更新 更多