Comments (9)
OK, some good points, BUT...
I use a lot of global modules to keep my projects clean.
I also use(d) Asar@<=0.8.2 for packaging my app, that didn't work because of the electron-prebuilt dependency, so I had to remove it...
It also works when I rebuild like this:
./node_modules/.bin/electron-rebuild -v 0.34.3 -e /usr/local/lib/node_modules/electron-prebuilt
But still, Y U NO looking for the global 'electron-prebuilt' module like U do for the local one?
from rebuild.
Best practice is to install electron-prebuilt
as a devDependency so your project is portable and consistent across environments. This avoids the "works on my machine" problem.
from rebuild.
Good news! There are two ways to fix this:
- Install electron-prebuilt as a dependency
- Specify the version of Electron you're using
from rebuild.
I'm still getting the same error when following NodeGit's guidelines for native modules here: https://github.com/electron/electron/blob/master/docs/tutorial/using-native-node-modules.md . I have installed electron-prebuilt, but it says thay it has been deprecated and that electron should be used, but I already had electron, so... is it deprecated or not? what should be the new path to take?
from rebuild.
@darkguy2008 It is depreceated, you should install the electron
module not electron-prebuilt
from rebuild.
@MarshallOfSound yeah, and that's what brought me here, because I was still seeing the same error. I'll clean up my repo and try again :/
Edit: Yup, installing just electron has no effect. I had to install electron-rebuild and then manually run the electron-rebuild command so it built nodegit correctly and fix an initializing DLL error with electron. I'm working on a private project, but a small use-case would be to make a small electron app with nodegit as dependency and try to call a sample routine to load a local repo, that's enough to make it error. If you run node-rebuild and try again, it just works.
As a solution, I installed electron-rebuild and put it as my postinstall script. No more errors! 👍
from rebuild.
I was trying to build opencv4nodejs and,
adding this script below and executing it did fix the problem (No need to install electron-rebuild)
"electron-rebuild": "electron-rebuild -v 5.0.4 -w opencv4nodejs",
from rebuild.
Best practice is to install
electron-prebuilt
as a devDependency so your project is portable and consistent across environments. This avoids the "works on my machine" problem.
Do you Mean This??
npm install --save-dev electron-rebuild
from rebuild.
npm install --save-dev electron-rebuild
Did not work. Alas
from rebuild.
Related Issues (20)
- extraResources does not work as expected, nothing is copied HOT 1
- How can I tell electron-rebuild to ignore my library? HOT 4
- How to rebuild .node file without existing in a node_module?
- 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
- need to upgrade node-gyp HOT 6
- 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
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.