Electron-packager: Unable to determine application name or Electron version

Created on 7 Oct 2016  路  9Comments  路  Source: electron/electron-packager

Getting the error Unable to determine application name or Electron version when running:
electron-packager . --all

My package.json looks like so:

{
  "name": "app",
  "productName": "app",
  "version": "0.0.1",
  "description": "Hangouts as an application",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "author": "Allen Hendricks",
  "license": "ISC",
  "devDependencies": {
    "electron": "^1.4.1"
  },
  "dependencies": {}
}

I am 100% for sure in the root directory of my app for running the command line.

needs info

Most helpful comment

@transfluxus You need to run npm install --save-dev electron so that Electron Packager can infer the version from package.json.

All 9 comments

Thanks for filing an issue! In order to help you with your problem, we're going to need more information about it. In particular:

  • Console output when you run electron-packager with the environment variable DEBUG=electron-packager. On Windows, run SET DEBUG=electron-packager before running your electron-packager command.

Not long ago, i run command electron-packager ./ --all,everything work fine to me.
But today when i run electron-packager ./ --all command,it doesn't work.

20161014095247

Before my package.json file content like below:

{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/electron/electron-quick-start.git"
  },
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "bugs": {
    "url": "https://github.com/electron/electron-quick-start/issues"
  },
  "homepage": "https://github.com/electron/electron-quick-start#readme",
  "devDependencies": {
    "electron-prebuilt": "^1.2.0"
  },
  "dependencies": {
    "express": "^4.10.2",
    "node-notifier": "^4.6.1",
    "reconnectingwebsocket": "^1.0.0",
    "socket.io": "^1.4.8"
  }
}

I found this commit https://github.com/electron/electron-quick-start/commit/35a725f479f28623746054be7593bfa1bd9f7d35.

So i change my package.json like this:

{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/electron/electron-quick-start.git"
  },
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "bugs": {
    "url": "https://github.com/electron/electron-quick-start/issues"
  },
  "homepage": "https://github.com/electron/electron-quick-start#readme",
  "devDependencies": {
    "electron": "^1.3.4"
  },
  "dependencies": {
    "express": "^4.10.2",
    "node-notifier": "^4.6.1",
    "reconnectingwebsocket": "^1.0.0",
    "socket.io": "^1.4.8"
  }
}


It work now.

Since the original issue reporter has not responded to the request for additional information in about two weeks, I'm going to assume that they either found the answer in another manner or decided not to pursue this issue. If I'm incorrect, they can respond with answers to the questions posed, and I'll reopen.

I have that issue on OSX.
after
npm install electron-packager -g
and
electron-packager . coolapp --platform=win32
or
electron-packager . coolapp -all
I get that

@transfluxus You need to run npm install --save-dev electron so that Electron Packager can infer the version from package.json.

@malept I got this error when I moved electron into optional dependencies. Could electron-packager be updated to recognise it there? Alternatively, is there a way to specify the electron version as the error message suggests? (I tried --version 1.4.15 and --electron-version 1.4.15 to no avail... if there isn't a way to do it, maybe at least that error message should be changed?)

@voltrevo why are you putting Electron into optionalDependencies?

@voltrevo

Alternatively, is there a way to specify the electron version as the error message suggests?

Running electron-packager . --electron-version=1.4.15 when electron is not in package.json works for me.

@malept

why are you putting Electron into optionalDependencies?

because producing an electron app is a side-thing for the project - it mainly just runs in the browser. I had problems with the electron stuff installing on Travis for the integration tests because it's linux. It may have just been the Mac app bundler package that Travis (understandably) didn't like, but to fix it I lumped all the electron related dependencies together and just made them optional.

Running electron-packager . --electron-version=1.4.15 when electron is not in package.json works for me.

Ahh --electron-version 1.4.15 works for me too. Not sure what I did differently before. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rafaelcastrocouto picture rafaelcastrocouto  路  3Comments

andreabisello picture andreabisello  路  3Comments

quadrophobiac picture quadrophobiac  路  4Comments

caishengmao picture caishengmao  路  3Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  4Comments