Electron-packager: Unable to determine Electron version. Please specify an Electron version.

Created on 9 Mar 2017  路  7Comments  路  Source: electron/electron-packager

  • [x ] I have read the contribution documentation for this project.
  • [x] I agree to follow the code of conduct that this project follows, as appropriate.
  • [ ] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:
I want to make a packeger for my electron app but i have this error, what i do wrong

this is the command

electron-packager C:\Users\myName\Desktopelectron_tests\myApp --platform=win32 --arch=x64 myApp-built

Console output when you run electron-packager with the environment variable DEBUG=electron-packager. Please include the stack trace if one exists.

Put the console output here

Unable to determine Electron version. Please specify an Electron version

For more information, please see
https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#version

What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the packager() function?

Put the arguments or parameters here

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-quick-start
is a good starting point.

question

Most helpful comment

You need to either:

  • run npm install --save-dev electron
  • add --electron-version=1.6.2 to the electron-packager command _(Electron 1.6.2 is just the latest stable version at the time of this comment - any version will do)_

I suggest the first option.

All 7 comments

You need to either:

  • run npm install --save-dev electron
  • add --electron-version=1.6.2 to the electron-packager command _(Electron 1.6.2 is just the latest stable version at the time of this comment - any version will do)_

I suggest the first option.

1 min before i just typ npm install electron --save-dev insted of npm install --save-dev electron

i have the electron prbuilt instaled and my code with node modules are 184 mb now i gon install and the electon and my code is gona be 230 mb that is problem ???

my package.json is like this were to put the --electron-version ??

{
  "name": "app_test",
  "version": "1.0.0",
  "description": "makari na doulepsi",
  "main": "main.js",
  "scripts": {
    "start": "electron main.js"
  },
  "author": "George",
  "license": "MIT",
  "dependencies": {
    "firebase": "^3.7.0"
  },
  "devDependencies": {
    "electron": "^1.3.4"
  }
}

i have the electron prbuilt instaled and my code with node modules are 184 mb now i gon install and the electon and my code is gona be 230 mb that is problem ???

I'm not sure what you're asking. Yes, it's going to be pretty big when you package it. That is the downside to building Electron apps (instead of, for example, writing a native desktop application). I did a quick analysis of Electron 1.3.x in another issue - it was ~100MB just for the 32-bit Windows runtime.

my package.json is like this were to put the --electron-version ??

You either needed to do one or the other, not both. You don't need to add the --electron-version flag since you added electron to devDependencies.

ok thnx worked

You need to either:

  • run npm install --save-dev electron
  • add --electron-version=1.6.2 to the electron-packager command _(Electron 1.6.2 is just the latest stable version at the time of this comment - any version will do)_

I suggest the first option.

This worked for me.

matthew

Was this page helpful?
0 / 5 - 0 ratings