node-gyp: gyp ERR! stack Error: `make` failed with exit code: 2 How to fix this?

  • Node Version: node v16.16.0, npm v8.11.0

  • Platform: macOS 12.4 (21F79) M1

  • Compiler: Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: arm64-apple-darwin21.5.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

  • Module: node-gd

Verbose output (from npm or node-gyp):
$node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.1
gyp info using node@16.16.0 | darwin | arm64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: *** No targets specified and no makefile found.  Stop.
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/lib/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.5.0
gyp ERR! command "/opt/homebrew/Cellar/node@16/16.16.0/bin/node" "/opt/homebrew/bin/node-gyp" "build"
gyp ERR! cwd /Users/Maxorz
gyp ERR! node -v v16.16.0
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

$ls -al /opt/homebrew/opt/node@16
lrwxr-xr-x  1 Maxorz  admin    25B Aug 29 16:40 /opt/homebrew/opt/node@16@ -> ../Cellar/node@16/16.17.0