question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node-gyp rebuild fails in macOS Catalina (10.15) - No rule to make target `node_modules/node-gyp/addon.gypi`, needed by `Makefile'.

See original GitHub issue
  • Node Version: 10.10.0 / 6.4.1
  • Platform: Darwin Matts-MBP-3.local 19.0.0 Darwin Kernel Version 19.0.0: Fri May 24 17:36:10 PDT 2019; root:xnu-6041.0.0.111.5~1/RELEASE_X86_64 x86_64
  • Compiler: Apple clang version 11.0.0 (clang-1100.0.20.17) Target: x86_64-apple-darwin19.0.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  • Module: Failure occurred during better-sqlite3@5.4.0 install as part of electron-builder
Verbose output (from npm or node-gyp):
> electron-builder install-app-deps --arch x64

  • electron-builder version=20.26.1
  • rebuilding native production dependencies platform=darwin arch=x64
Error: /usr/local/Cellar/node/10.10.0/bin/node exited with code 1
Output:

> better-sqlite3@5.4.0 install /Users/mattcowley/WebstormProjects/MagicCap/node_modules/better-sqlite3
> node-gyp rebuild


Error output:
make: *** No rule to make target `../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', needed by `Makefile'.  Stop.
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 19.0.0
gyp ERR! command "/usr/local/Cellar/node/10.10.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mattcowley/WebstormProjects/MagicCap/node_modules/better-sqlite3
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@5.4.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the better-sqlite3@5.4.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mattcowley/.npm/_logs/2019-06-16T10_20_00_103Z-debug.log

    at ChildProcess.childProcess.once.code (/Users/mattcowley/WebstormProjects/MagicCap/node_modules/builder-util/src/util.ts:255:14)
    at Object.onceWrapper (events.js:273:13)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)
From previous event:
    at rebuild (/Users/mattcowley/WebstormProjects/MagicCap/node_modules/app-builder-lib/out/util/yarn.js:238:18)
    at /Users/mattcowley/WebstormProjects/MagicCap/node_modules/app-builder-lib/src/util/yarn.ts:20:11
From previous event:
    at installOrRebuild (/Users/mattcowley/WebstormProjects/MagicCap/node_modules/app-builder-lib/out/util/yarn.js:68:17)
    at /Users/mattcowley/WebstormProjects/MagicCap/node_modules/electron-builder/src/cli/install-app-deps.ts:56:9
    at Generator.next (<anonymous>)
    at runCallback (timers.js:694:18)
    at tryOnImmediate (timers.js:665:5)
    at processImmediate (timers.js:647:5)
From previous event:
    at installAppDeps (/Users/mattcowley/WebstormProjects/MagicCap/node_modules/electron-builder/out/cli/install-app-deps.js:174:17)
    at then (/Users/mattcowley/WebstormProjects/MagicCap/node_modules/electron-builder/src/cli/cli.ts:42:48)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! magiccap@1.1.0-b4 postinstall: `electron-builder install-app-deps --arch x64`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the magiccap@1.1.0-b4 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mattcowley/.npm/_logs/2019-06-16T10_20_00_173Z-debug.log

2019-06-16T10_20_00_103Z-debug.log

2019-06-16T10_20_00_173Z-debug.log

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:62 (14 by maintainers)

github_iconTop GitHub Comments

124reactions
MattIPv4commented, Jun 16, 2019

Same issue occurs if node-gyp is forced to 5.0.0 in the package by doing npm i -g node-gyp@latest && npm config set node_gyp "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js"

30reactions
hphoeksmacommented, Nov 11, 2019

Upon opening Xcode I noticed the location for the Command Line Tools were empty. (Preferences > Locations). After selecting the tools there, I could run the install.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix broken 'node-gyp' issue for Mac OS | by Fernando De Freitas
nodejs/node-gyp: node-gyp rebuild fails in macOS Catalina (10.15) — No rule to make target `node_modules/node-gyp/addon.gypi`, needed by `Makefile`- Github ...
Read more >
No rule to make target `node_modules/node-gyp/addon.gypi ...
This issue may be an issue with Catalina and its command line build toolchain, rather than Node/node-gyp. – danpalmer. Jul 2, 2019 at...
Read more >
gyp: No Xcode or CLT version detected - ERR! configure error ...
If your macOS got upgraded to Catalina (10.15) recently, then you will find the fix right here. Explainer Video:.
Read more >
node-gyp | Yarn - Package Manager
Build Status npm. node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js.
Read more >
node-gyp - npm
Node.js native addon build tool. Latest version: 9.3.1, last published: 2 days ago. Start using node-gyp in your project by running `npm i ......
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found