Giter VIP home page Giter VIP logo

Comments (9)

MathijsvVelde avatar MathijsvVelde commented on June 27, 2024 6

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.

zeke avatar zeke commented on June 27, 2024 1

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.

anaisbetts avatar anaisbetts commented on June 27, 2024

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.

darkguy2008 avatar darkguy2008 commented on June 27, 2024

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.

MarshallOfSound avatar MarshallOfSound commented on June 27, 2024

@darkguy2008 It is depreceated, you should install the electron module not electron-prebuilt

from rebuild.

darkguy2008 avatar darkguy2008 commented on June 27, 2024

@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.

lazzy07 avatar lazzy07 commented on June 27, 2024

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.

deepanshumehtaa avatar deepanshumehtaa commented on June 27, 2024

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.

jahbini avatar jahbini commented on June 27, 2024

npm install --save-dev electron-rebuild
Did not work. Alas

from rebuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.