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

Unable to find electron-prebuilt's version number #35

Closed
MathijsvVelde opened this issue Nov 9, 2015 · 9 comments
Closed

Unable to find electron-prebuilt's version number #35

MathijsvVelde opened this issue Nov 9, 2015 · 9 comments

Comments

@MathijsvVelde
Copy link

Le me at the computer

Le-me PC:app Le-me$ ./node_modules/.bin/electron-rebuild 
Unable to find electron-prebuilt's version number, either install it or specify an explicit version

WTF
Y U NO
Y U NO looking for a global installed 'electron-prebuilt' module and/or define an available version in your package.json@devDependencies!!

I'm just saying
Thanks!!

@anaisbetts
Copy link
Contributor

Good news! There are two ways to fix this:

  • Install electron-prebuilt as a dependency
  • Specify the version of Electron you're using

@MathijsvVelde
Copy link
Author

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?

MathijsvVelde added a commit to MathijsvVelde/electron-rebuild that referenced this issue Nov 10, 2015
[change cli.js](electron#35)
Like this
@zeke
Copy link
Contributor

zeke commented Aug 4, 2016

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.

@zeke zeke closed this as completed Aug 4, 2016
@darkguy2008
Copy link

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?

@MarshallOfSound
Copy link
Member

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

@darkguy2008
Copy link

darkguy2008 commented Apr 26, 2017

@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! 👍

@lazzy07
Copy link

lazzy07 commented Jun 24, 2019

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",

@deepanshumehtaa
Copy link

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

@jahbini
Copy link

jahbini commented May 30, 2021

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

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

8 participants