Electron-forge: Launching Electron Forge with --experimental-modules

Created on 25 Jun 2019  Â·  7Comments  Â·  Source: electron-userland/electron-forge

  • [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.
  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

I'm trying to enable ES6 modules using electron-forge start -- --experimental-modules but I'm getting the following output:

error: unknown option `--experimental-modules'

I'm using Git Bash on Windows 10.

Most helpful comment

Node.js 13.2.0 recently removed the --experimental-modules flag, making ES Modules enabled by default. 🎉

So we'll have it by default once Electron starts using Node 13.2 or higher.

All 7 comments

What version of Electron Forge are you using?

Also, what version of Electron are you using?

@malept Here you go:

C:\Users\richi>node -v
v12.4.0

C:\Users\richi>npm -v
6.9.0

C:\Users\richi>yarn -v
1.16.0

C:\Users\richi>electron -v

 v5.0.5

C:\Users\richi>electron-forge --version
√ Checking your system
6.0.0-beta.39

What is the Electron version in your project? (See package.json)

On a related note: you should avoid installing Electron globally.

@malept It's on version v5.0.5.

Here's all the other packages I am using.

I think you're supposed to put --experimental-modules in the NODE_OPTIONS environment variable, but that doesn't work when you package the app.

If you want ES Module support, your best bet is esm with minimal changes.

Node.js 13.2.0 recently removed the --experimental-modules flag, making ES Modules enabled by default. 🎉

So we'll have it by default once Electron starts using Node 13.2 or higher.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RobiFerentz picture RobiFerentz  Â·  4Comments

davidroman0O picture davidroman0O  Â·  5Comments

pkinnucan picture pkinnucan  Â·  4Comments

noahott picture noahott  Â·  5Comments

Skizu picture Skizu  Â·  5Comments