Warm tip: This article is reproduced from stackoverflow.com, please click
node-gyp node.js

Node 10

发布于 2020-03-27 10:21:48

I've recently upgraded to Node 10 and when I run npm install I get the following error:

make: *** [Release/obj.target/memwatch/src/init.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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Darwin 18.2.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 /Users/david/Documents/gitlab/project/node_modules/memwatch-next
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! memwatch-next@0.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the memwatch-next@0.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Working on 'macOS Mojave', I worked on the same project with Node10 without any issues. Please advise what can be causing the error?

Questioner
David Faizulaev
Viewed
136
David Faizulaev 2019-01-21 17:03

Resolved the issue by updating npm to latest version & running npm rebuild.