Comments (6)
overrides
didn't work for me, but this did:
pip install setuptools
or possibly
python3 -m pip install --break-system-packages setuptools
from rebuild.
As references in nodejs/node-gyp#2869 (comment), node-gyp v10+ solves this error; distutils was removed from python 3.12 as mentioned here, which causes this error.
A way to fix this is to add an overrides to your package.json
.
In my case (using pnpm) on the highest level in my package.json
:
"pnpm": {
"overrides": {
"node-gyp": "^10.0.0"
}
},
Do this according to how your package manager handles overrides.
If your package manager does not update correctly, check your lock file and confirm @electron/rebuild
has the depency node-gyp
set to some 10+ version, at the time of writing 10.0.1
. If this is the case, try deleting your lockfile and have it re-generate with e.g. pnpm i
or equivalent in your package manager.
/@electron/[email protected]:
resolution: {integrity: sha512-zF4x3QupRU3uNGaP5X1wjpmcjfw1H87kyqZ00Tc3HvriV+4gmOGuvQjGNkrJuXdsApssdNyVwLsy+TaeTGGcVw==}
engines: {node: '>=12.13.0'}
hasBin: true
dependencies:
'@malept/cross-spawn-promise': 2.0.0
chalk: 4.1.2
debug: 4.3.4
detect-libc: 2.0.2
fs-extra: 10.1.0
got: 11.8.6
node-abi: 3.56.0
node-api-version: 0.2.0
node-gyp: 10.0.1
ora: 5.4.1
read-binary-file-arch: 1.0.6
semver: 7.6.0
tar: 6.2.0
yargs: 17.7.2
transitivePeerDependencies:
- supports-color
dev: true
EDIT:
I have been fiddling around with this a while before I came to this conclusion which is not enough to get it running, so the above will not work.
I have edited the file node_modules\@electron\rebuild\lib\module-type\node-gyp\worker.js:29
to remove the promisify since v10 of node-gyp changes it's internals to return promises natively.
That is an integral part of the solution. I guess I'll see if I can cook up a PR to this project to resolve this issue.
from rebuild.
Hi,
I'm struggling to get electron-rebuild to work due to node-gyp version and Python version (as others reported above).
I've tried the so-called temp fix by adding the devDependency in my package.json to the latest node-gyp but it's not getting used by electron-rebuild.
Is there any other known workaround for this issue?
from rebuild.
can confirm same issue, a temp fix is to include the latest node-gyp
as a devDependency in YOUR package.json
npm install node-gyp --save-dev
should install 10.0.1
from rebuild.
can confirm same issue, a temp fix is to include the latest
node-gyp
as a devDependency in YOUR package.jsonnpm install node-gyp --save-dev
should install 10.0.1
thx for temp fix actually
from rebuild.
pip install setuptools
Thanks, this solutions worked for me on windows
from rebuild.
Related Issues (20)
- Error related to `.forge-meta` file HOT 1
- GCC_PREFIX_HEADER & GCC_PRECOMPILE_PREFIX_HEADER incompatible with Electron 20
- error rebuild canvas on Windows HOT 3
- Rebuilding node-canvas with electron-rebuild fails HOT 4
- Could not detect abi for version 22.3.3 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron at getAbi HOT 8
- no file node_modules/.bin/electron-rebuild in 3.2.11 HOT 1
- Error when rebuilding node-java package HOT 1
- Python 2 died 1,259 days ago on 1/1/2020. Why still use it? HOT 1
- Cross Compile on Linux
- Help using rebuild to package node-sqlite3 to use with Electron HOT 2
- ERR_REQUIRE_ESM HOT 1
- Follow OS conventions for storing cache
- it is not rebuilding for electron from the package root HOT 2
- Complains for deprecated move-file
- @electron/rebuild ignores symlinks for native modules, which crashes the application HOT 1
- Module build fails with empty binding.gyp HOT 3
- Windows CI Failing
- Not rebuilding with --which-module argument
- Pass arch armv7l as "arm" to node-gyp
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rebuild.