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

Creating/Starting new project fails with error "Error: Electron version 1.4.15 is either too old or too new" #148

Closed
3 tasks done
leifwells opened this issue Feb 25, 2017 · 14 comments
Labels
blocked/upstream Issues blocked by upstream bugs bug

Comments

@leifwells
Copy link

leifwells commented Feb 25, 2017

  • I have read the contribution documentation for this project.
  • 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:
Created a new application, started the application and received the following error:

App threw an error during load
Error: Electron version 1.4.15 is either too old or too new (While processing preset: "/Users/leifwells/Code/electron/ef-test/node_modules/babel-preset-env/lib/index.js")
    at getTargets (/Users/leifwells/Code/electron/ef-test/node_modules/babel-preset-env/lib/index.js:144:13)
    at buildPreset (/Users/leifwells/Code/electron/ef-test/node_modules/babel-preset-env/lib/index.js:209:17)
    at /Users/leifwells/Code/electron/ef-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:317:46
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/leifwells/Code/electron/ef-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/leifwells/Code/electron/ef-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/leifwells/Code/electron/ef-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/leifwells/Code/electron/ef-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/leifwells/Code/electron/ef-test/node_modules/babel-core/lib/transformation/file/index.js:216:65)
    at new File (/Users/leifwells/Code/electron/ef-test/node_modules/babel-core/lib/transformation/file/index.js:139:24)

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

Put the console output here

What command line arguments are you passing?

electron-forge init ef-test
cd ef-test
electron-forge start

What does your config.forge data in package.json look like?

"config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {},
      "electronWinstallerConfig": {
        "name": "ef_test"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "eftest"
      }
    }
  },

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.

@MarshallOfSound
Copy link
Member

It looks like we've lost some lines of the error trace including the message itself. Can you add those back in.

Initial idea though is you are using babel-env and simply need to update it to a newer version

@leifwells
Copy link
Author

Sorry for the improper formatting of my error message. I've updated it and made sure the whole message appears.

@MarshallOfSound
Copy link
Member

Yeah, looks like my guess was on the right path. Can you try blowing away your node_modules folder and reinstalling. (How long ago did you create this app?)

Can you also post your .compilerc

@swashcap
Copy link

Seeing a similar error on an app init-ed five minutes ago:

$ electron-forge start
✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies
✔ Launching Application
App threw an error during load
Error: Electron version 1.4.15 is either too old or too new (While processing preset: "/Users/creed/Sites/electron-forge-test/node_modules/babel-preset-env/lib/index.js")
    at getTargets (/Users/creed/Sites/electron-forge-test/node_modules/babel-preset-env/lib/index.js:144:13)
    at buildPreset (/Users/creed/Sites/electron-forge-test/node_modules/babel-preset-env/lib/index.js:209:17)
    at /Users/creed/Sites/electron-forge-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:317:46
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/creed/Sites/electron-forge-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/creed/Sites/electron-forge-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/creed/Sites/electron-forge-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/creed/Sites/electron-forge-test/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/creed/Sites/electron-forge-test/node_modules/babel-core/lib/transformation/file/index.js:216:65)
    at new File (/Users/creed/Sites/electron-forge-test/node_modules/babel-core/lib/transformation/file/index.js:139:24)

The process hangs. Here’s the .compilerc:

{
  "env": {
    "development": {
      "application/javascript": {
        "presets": [
          [
            "env",
            {
              "targets": {
                "electron": "1.4.15"
              }
            }
          ],
          "react"
        ],
        "plugins": [
          "transform-async-to-generator"
        ],
        "sourceMaps": "inline"
      }
    },
    "production": {
      "application/javascript": {
        "presets": [
          [
            "env",
            {
              "targets": {
                "electron": "1.4.15"
              }
            }
          ],
          "react"
        ],
        "plugins": [
          "transform-async-to-generator"
        ],
        "sourceMaps": "none"
      }
    }
  }
}

Relevant stats:

  • OS: OS X 10.12.3
  • Node.js: 7.5.0
  • npm: 4.1.2
  • electron-forge: 2.8.1

@swashcap
Copy link

Blowing away node_modules and re-installing produces an identical error. 😱

@janwiemers
Copy link

janwiemers commented Feb 25, 2017

Having the same error tried upgrading to electron v1.6.1 and now have the following message

> [email protected] start /Users/jansoeren.wiemers/Repositories/NSDKIS
> electron-forge start

✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies
✔ Launching Application
App threw an error during load
Error: Electron version 1.6.1 is either too old or too new (While processing preset: "/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-preset-env/lib/index.js")
    at getTargets (/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-preset-env/lib/index.js:144:13)
    at buildPreset (/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-preset-env/lib/index.js:209:17)
    at /Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-core/lib/transformation/file/options/option-manager.js:317:46
    at Array.map (native)
    at OptionManager.resolvePresets (/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-core/lib/transformation/file/index.js:216:65)
    at new File (/Users/jansoeren.wiemers/Repositories/NSDKIS/node_modules/babel-core/lib/transformation/file/index.js:139:24)
  • OS: macOS (10.11.6)
  • Node: v7.6.0
  • NPM: v4.1.2
  • electron-forge: v2.8.1

@malept
Copy link
Member

malept commented Feb 25, 2017

The workaround is: pin babel-preset-env to 1.1.8.

@janwiemers
Copy link

I figured that the version of electron-to-chrome is pretty old and returns undefined. The latest version of this library will support the updated version of both chrome and electron.
The library is loaded in babel-present-env

@janwiemers
Copy link

haha^^ to late :)

@malept
Copy link
Member

malept commented Feb 25, 2017

@janwiemers yeah, I think you're right, my guess is that babel/babel-preset-env#144 is causing it.

@malept
Copy link
Member

malept commented Feb 25, 2017

I think I can make a PR to babel-preset-env for this problem, let me take a crack at it.

@malept
Copy link
Member

malept commented Feb 25, 2017

People affected by this bug, please use the workaround in my earlier comment until Kilian/electron-to-chromium#4 is merged & released.

@malept malept added bug blocked/upstream Issues blocked by upstream bugs labels Feb 25, 2017
@malept
Copy link
Member

malept commented Feb 25, 2017

This bug should be fixed! I have verified it on the app I was using to test the behavior. Please let me know if this specific error still persists after running npm update or whatever the yarn equivalent is.

@malept malept closed this as completed Feb 25, 2017
@janwiemers
Copy link

@malept yeah I can confirm it's working fine now.
Thanks

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
fix: Ensure correct version selection & display
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/upstream Issues blocked by upstream bugs bug
Projects
None yet
Development

No branches or pull requests

5 participants