electron / packager

Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI
https://npm.im/@electron/packager
BSD 2-Clause "Simplified" License
171 stars 17 forks source link

Unable to determine Electron version. Please specify an Electron version. #617

Closed ghost closed 7 years ago

ghost commented 7 years ago

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\Desktop\electron_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.

malept commented 7 years ago

You need to either:

I suggest the first option.

ghost commented 7 years ago

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 ???

ghost commented 7 years ago

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"
  }
}
malept commented 7 years ago

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.

ghost commented 7 years ago

ok thnx worked

Lucaslah commented 4 years ago

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-Bramballo commented 4 years ago

matthew