当我尝试通过npm安装ember-cli时,按照官方文档,我收到此错误:
9 errors generated.
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit(/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ember-cli/node_modules/bufferutil
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ember-cli"
npm ERR! node v4.0.0
npm ERR! npm v3.3.5
npm ERR! code ELIFECYCLE
npm ERR! bufferutil@1.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bufferutil@1.1.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bufferutil package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bufferutil
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/sandropalmieri/npm-debug.log
我曾多次尝试使用sudo运行命令,但仍然遇到这种错误。知道发生了什么事吗?你能帮忙吗?感谢
答案 0 :(得分:1)
尝试在npm install命令中添加--no-optional。
您使用的是npm 3.3.3吗?请在此处查看问题:https://github.com/ember-cli/ember-cli/issues/4873
答案 1 :(得分:0)
安装节点
节点-v
v12.14.1
哪个npm
/ usr / local / bin / npm
npm -v
6.13.4
npm install-保存core-js @ ^ 3
sudo npm install -g ember-cli
哪个灰烬
/ usr / local / bin / ember
琥珀色-v
ember-cli:3.16.0
节点:12.16.1
os:达尔文x64