-
Notifications
You must be signed in to change notification settings - Fork 44
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
gyp: binding.gyp not found (...) while trying to load binding.gyp #156
Comments
Having the same issue since at least Aug 16: |
In my case @parcel/watcher is a direct dependency of another package. Solved by fixing version on that dependency:
|
Hi, I use nuxt which uses this package. I'm using nuxt behind a proxy and in a node18-alpine3.17 docker container. Since version 2.2.0, the "npm install" command, when it arrives at the @parcel/watcher module, tries to compile using python and gyp which itself tries for an unknown reason to download node despite the fact that it is already available locally since I'm using a node container. My proxy refuses the download. The problem is also present in all other docker images, whether node20-alpine or node20-debian. The temporary solution is r-r-lima's answer, to do an ovverides to version 2.1.0 Is it possible to resolve this problem? |
I have the same exact error when installing Nuxt. |
So, is anything happening with this? |
Someone needs to investigate why the prebuilds (e.g. In https://unpkg.com/browse/@parcel/watcher@2.3.0/index.js, print out the |
I have the same exact error when installing Nuxt. |
This looks suspiciously like the infamous npm lockfile bug - see npm/cli#2606 - possible workaround in npm/cli#2606 (comment) |
I've had similar problems. 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 npm 18 or 16 and Python 3.11, and MacOS 12.6.5 with npm 18 or 16 and Python 3.10. The problems seem to start in "@parcel/watcher": "~2.2.0" with its "node-addon-api": "^7.0.0" dependency, whereas "@parcel/watcher": "~2.1.0" with node-addon-api: ^3.2.1 and node-gyp-build: ^4.3.0 dependencies works. |
Solution temp package.json
|
Experiencing the same while attempting an npm install on a Nuxt 3 project. A few others in my team are also experiencing this but some are not. |
+1 |
+1 node: 21.4.0 (installed via apk) |
+1 Updated package.lock in nuxt 3 and thought it’s the infamous npm cache permissions bug. But even after chowning and reinstalling node, the error stayed. Turns out it was due to this package. Tested overrides with all sorts of in-between versions. The first version to work is 2.1.0 Env: |
Override @parcel/watcher to 2.1.0 to work around parcel-bundler/watcher#156
Can confirm that this causes fresh nuxt installations to fail when using |
Can reproduce this issue as well when running
Running with the override worked as expected. |
I ran ├── @parcel/watcher@2.1.0 overridden
└─┬ nitropack@2.8.1
└─┬ listhen@1.6.0
└── @parcel/watcher@2.1.0 deduped |
Same here. My workaround: "overrides": {
"@parcel/watcher": "~2.1.0"
} |
First time trying Nuxt today, and I get this :( |
@mischnic Here are 2 Dockerfiles for reproducing the error. Failing DockerfileFROM ubuntu:latest
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
gnupg \
ca-certificates \
wget \
g++ \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& npm install -g npm@latest \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /home Build and run: docker build -t npm-20.
docker run -it --rm npm-20 Then, inside the running container: npm i -g @parcel/watcher ❌ Error:
Working DockerfileFROM ubuntu:latest
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
gnupg \
ca-certificates \
wget \
g++ \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /home Build and run: docker build -t npm-18 .
docker run -it --rm npm-18 Then, inside the running container: npm i -g @parcel/watcher ✔️ Result:
|
I tried some more combinations of Node and npm:
|
Can reproduce this with 'npm install' in a SolidJS project. $ node –version [host@myhost site]$ npm install npm ERR! A complete log of this run can be found in: /home/host/.npm/_logs/2024-02-05T14_27_16_860Z-debug-0.log |
There is another combination that does not work: I did not find any npm version that can install ❌ Fails (even with npm v10.3.0): registry=https://myartifactory6server.mycompany.com/artifactory/api/npm/NPM-REMOTE/
always-auth=true We have to switch off the proxying explicitly for namespace ✔️ Works (with npm v10.3.0): registry=https://myartifactory6server.mycompany.com/artifactory/api/npm/NPM-REMOTE/
@parcel:registry=https://registry.npmjs.org/
always-auth=true |
Confirming the downgrade to npm v10.3.0 fixed the issue for me while using Node v20.11.0 Was on npm v10.4.0 and trying to set up Analog.js using
After downgrading, the install completed successfully. |
It works thanks! |
node 21.6.1 It worked for me |
node: 20.11.0 Didn't work for me. What worked for me is specifying 2.1.0 as a version. 2.2.0, 2.3.0 and 2.4.0 didn't work at all. |
I don't understand what we are supposed to do about this issue. Appears to be common but I don't think it's our fault? Seems like a bug in npm? Is that the consensus here? Has anyone reported this to npm yet? Does it work with other package managers (e.g. yarn/pnpm)? |
Unfortunately, our solution was to switch to |
@devongovett PR #144 removed the
I think this erroneous A few possible solutions, from hardest to easiest:
npm v10.4.0 introduced npm/run-script#192 which completely changes the way that |
Great info @lovell! Thanks so much for sharing. It's interesting because this seems to have been happening even before npm 10.4 Perhaps that's actually a different issue (with lockfiles?) though. I updated our publishing workflow to copy the files needed into a separate directory and run npm publish from there. That way binding.gyp doesn't get added by npm (even though it already wasn't included in package.json In a related change, I also added better error handling to the package so that if an error occurs while requiring the native module, we only continue trying fallback locations if the error was a module not found error. Other errors (e.g. incompatibilities with OS versions) are re-thrown so they are reported to users. These changes are published in v2.4.1. I tested locally with npm 10.4.0 and was able to install the package successfully. Please let me know if you continue to run into issues. |
only V.10.40 worked for me |
… have incompatibilities with npm 10.4 (see parcel-bundler/watcher#156) or the watcher hangs ~5% of the time when unsubscribing (see #623 (comment))
* upgrade non-breaking dev dependencies * why rewire... * forgot .only * upgrade prod dependencies * silence grandpa eslint who cannot resolve a `require` * not sure why test is passing locally but failing in CI * .only * debug CI * debug CI - try force color in diff * debug CI colors * debug CI colors * okay that fixed it, revert test back and remove logs * .only * remove unnecessary `{ color: true }` parameter * comment eslint ignore * sonar * will this space make sonar happy? * will this? * this should. * clamp `@parcel/watcher` to v2.1.0 because more recent versions either have incompatibilities with npm 10.4 (see parcel-bundler/watcher#156) or the watcher hangs ~5% of the time when unsubscribing (see #623 (comment)) * remove todos
For anyone experiencing this issue on Ubuntu 22.04 ARM64 and Node 16.20.1 installed as a snap (I need to re-package legacy stuff, don't ask), // Add this to package.json
"overrides": {
"@parcel/watcher": "2.2.0"
} |
npm i @parcel/watcher
fails with the error in the title when trying to install right afternpm init
. I'm sure this has something to do with my environment but I do not understand what is wrong.node: 18.15.0 (installed via nvm)
npm: 9.5.0
Python: 3.10.4
OS: macOS Ventura 13.4
Computer: Apple M1 Macbook Pro, 16-inch 2021
Full error:
The text was updated successfully, but these errors were encountered: