Janarthanan
Janarthanan

Reputation: 1691

Unable to find electron-prebuilt's version number. - When trying to use electron-rebuild

I am trying to use bluetooth-serial-port native module in electron (atom-shell). I did the following.

  1. Installed electron-prebuilt.

npm install electron-prebuilt -g npm install electron-prebuilt --save-dev

  1. Installed electron-rebuild

npm install --save-dev electron-rebuild

  1. Installed bluetooth-serial-port

npm install bluetooth-serial-port --msvs_version=2013

  1. Running electron-rebuild command.

./node_modules/.bin/electron-rebuild

and I am getting the following error.

Unable to find electron-prebuilt's version number, either install it or specify an explicit version"

Can anyone help?

Upvotes: 16

Views: 8766

Answers (4)

Ada
Ada

Reputation: 1913

I found my electron version by running npm list electron:

`-- [email protected]

Then I specified the version number in the command: ./node_modules/.bin/electron-rebuild -f -w 26.0.0

This solved the issue for me.

Upvotes: 1

akamaozu
akamaozu

Reputation: 705

In the root folder of your project, use this:

node_modules/.bin/electron -v

If you're on a Windows machine, use back slashes in the path.

node_modules\.bin\electron -v

This is what mine looks like: v0.28.3

Upvotes: 2

Iron Gremlin
Iron Gremlin

Reputation: 407

You can see your electron version number by running electron with no arguments..

Example:

cd ./my_project
npm install --save-dev electron-prebuilt
node_modules/.bin/electron

You should get a little welcome notice that displays your version number.

If you've installed electron pre-built globally, just run the 'electron' command for the same result.

Upvotes: 1

Janarthanan
Janarthanan

Reputation: 1691

Install the electron-prebuilt on the same folder level.

Upvotes: 5

Related Questions