Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Error on Node 20: spawn node-gyp ENOENT #1440

Closed
PirosB3 opened this issue Oct 1, 2023 · 1 comment
Closed

Installation Error on Node 20: spawn node-gyp ENOENT #1440

PirosB3 opened this issue Oct 1, 2023 · 1 comment
Labels
s-noop Cannot be worked on

Comments

@PirosB3
Copy link

PirosB3 commented Oct 1, 2023

What is the bug?

When trying to add the @farcaster/hub-nodejs package using Yarn using Node v20.5.1, I encountered the following error:

yarn add @farcaster/hub-nodejs

yarn add v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
[1/3] ⠄ ref-napi
[-/3] ⠄ waiting...
error /Users/danielpyrathon/Desktop/Projects/farcaster-stuff/node_modules/ref-napi: Command failed.
Exit code: 1
Command: node-gyp-build
Arguments:
Directory: /Users/danielpyrathon/Desktop/Projects/farcaster-stuff/node_modules/ref-napi
Output:
node:events:492
      throw er; // Unhandled 'error' event
      ^

Error: spawn node-gyp ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ]
}

Node.js v20.5.1

Upon switching to v18.17.1 (via nvm) the issue disappears.
I am on MacOS Ventura (Apple M1 Pro). I installed my node via nvm

To reproduce:

Run yarn add @farcaster/hub-nodejs on v20.5.1

Expected Behavior:
The package should be added successfully.

Actual Behavior:

Encountered an error related to node-gyp.

Let me know how I can help! and thanks for your support. I'm not blocked in any way since i can simply develop using Node 18.

@github-actions github-actions bot added the s-triage Needs to be reviewed, designed and prioritized label Oct 1, 2023
@sds sds added s-noop Cannot be worked on and removed s-triage Needs to be reviewed, designed and prioritized labels Oct 9, 2023
@sds
Copy link
Member

sds commented Oct 9, 2023

FWIW I'm not able to reproduce this with Node 20.5.1 on my machine (macOS Ventura 13.5.2).

However, based on the error it looks like you might not have Python installed on your system, or NPM is unable to find it. You can find some suggestions of how to resolve in this thread, but I'm going to close since I'm unable to reproduce.

@sds sds closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s-noop Cannot be worked on
Projects
None yet
Development

No branches or pull requests

2 participants