【发布时间】: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