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

v2.2.0 node-gyp rebuild error, incorrect scripts in npm registry #153

Open
emjaksa opened this issue Aug 16, 2023 · 11 comments
Open

v2.2.0 node-gyp rebuild error, incorrect scripts in npm registry #153

emjaksa opened this issue Aug 16, 2023 · 11 comments

Comments

@emjaksa
Copy link

emjaksa commented Aug 16, 2023

Hi,
I am experiencing an unusual error with the latest version 2.2.0. When I try npm i @parcel/watcher I get the following error.

gyp: binding.gyp not found (cwd: /Users/myuser/Development/temp) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:325:16)
gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 22.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/myuser/Development/temp
gyp ERR! node -v v18.17.1
gyp ERR! node-gyp -v v9.4.0
gyp ERR! not ok

From what I can tell, in version 2.2.0 the install script ("install": "node-gyp rebuild") was removed but it is still showing in the npm registry under version 2.2.0. https://registry.npmjs.org/@parcel%2fwatcher (versions['2.2.0'].scripts)

OS: MacOS 13.4.1
node: 18.17.1
npm: 9.6.7

@DustInComp
Copy link

DustInComp commented Aug 18, 2023

Same error on Windows 10
node: 18.17.1
npm: 9.8.1
node_gyp: 9.4.0

npm i @parcel/[email protected] installs just fine.
npm i @parcel/[email protected] --ignore-scripts works too but that's not the way to go.

I'm adding "@parcel/watcher": "~2.1" to my dependencies until this is fixed.

@devongovett
Copy link
Member

I don't understand why the npm registry would have that extra script. It doesn't not appear in the package.json https://unpkg.com/browse/@parcel/[email protected]/package.json

@DustInComp
Copy link

DustInComp commented Aug 24, 2023

I don't understand why the npm registry would have that extra script. It doesn't not appear in the package.json

It's right there, named build (originally rebuild (834994b), before you renamed it with v2.2.0-alpha.0).

Correct me if I'm wrong but I see two issues that were introduced in 062bca4:

  • prebuilds are no longer used because the prebuilds dir created by prebuildify isn't packaged anymore and the recommended "install": "node-gyp-build" script was removed. Instead, there's now a build script that tries to run node-gyp rebuild when the package is installed.
  • node-gyp rebuild fails because src and bindings.gyp were removed from the package files as well

@hwhh
Copy link

hwhh commented Aug 29, 2023

Any news on this?

@SliverYuki
Copy link

I'm also having the same issue, is there any progress, please

@DustInComp
Copy link

Issue persists in v2.3.0 btw.

@SliverYuki
Copy link

Issue persists in v2.3.0 btw.

unfortunately, I feel like they're not going to fix this

@kmashint
Copy link

kmashint commented Oct 7, 2023

I had to use "@parcel/watcher": "~2.1.0" in my project devDependencies to avoid problems with 'gyp: binding.gyp not found' on both Windows 10 with Python 3.11 and MacOS 12.6.5 with Python 3.10. The problems seem to start in "@parcel/watcher": "~2.2.0" with its "node-addon-api": "^7.0.0" dependency.

@DustInComp
Copy link

DustInComp commented Nov 22, 2023

npm install --save-dev parcel, as described in the docs, fails in a clean project directory. How is this not getting more attention?

@mischnic
Copy link
Member

mischnic commented Nov 22, 2023

@DustInComp Which OS, Node and npm version are you using?

@DustInComp
Copy link

Which OS, Node and npm version are you using?

@mischnic Windows 10 Pro 19045.3693, Node 20.9.0, npm 10.2.4

Actually, I seem to have just resolved the issue on my end by updating our private package registry/proxy from Verdaccio version 5.14.0 to 5.27.0. However, I'm not sure how this update actually fixed the problem. The only change in installation I can find is the modules' "resolved" file paths in the package-lock.json.
Before: https://<verdaccio>/@parcel%2fwatcher/-/watcher-2.3.0.tgz
After: https://<verdaccio>/@parcel/watcher/-/watcher-2.3.0.tgz

Maybe other users who've had this issue had a similar setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants