Electron-forge: Electron 9 builds are failing

Created on 21 May 2020  路  12Comments  路  Source: electron-userland/electron-forge

Preflight Checklist

  • [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 a bug that matches the one I want to file, without success.

Issue Details

  • Electron Forge Version:

    • 6.0.0-beta.51

  • Electron Version:

    • 9.0.0

  • Operating System:

    • Windows 10 (2004)

  • Last Known Working Electron Forge version::

    • 6.0.0-beta.51 with Electron 8.2.5

Expected Behavior

Command "electron-forge start" launching the app

Actual Behavior

Command "electron-forge start" produces error:

An unhandled error has occurred inside Forge:
Could not detect abi for version 9.0.0 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron
Error: Could not detect abi for version 9.0.0 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron
at Object.getAbi (D:\mtgap\node_modules\node-abi\index.js:30:9)
at new Rebuilder (D:\mtgap\node_modules\electron-rebuildsrc\rebuild.ts:124:24)
at rebuildWithOptions (D:\mtgap\node_modules\electron-rebuildsrc\rebuild.ts:514:21)
at doRebuild (D:\mtgap\node_modules\electron-rebuildsrc\rebuild.ts:567:12)
at asyncFn (D:\mtgap\node_modules\@electron-forge\coresrc\util\rebuild.ts:15:23)
at D:\mtgap\node_modules\@electron-forge\async-orasrc\ora-handler.ts:35:5
at new Promise ()
at asyncOra (D:\mtgap\node_modules\@electron-forge\async-orasrc\ora-handler.ts:34:10)
at _default (D:\mtgap\node_modules\@electron-forge\coresrc\util\rebuild.ts:14:9)
at _default (D:\mtgap\node_modules\@electron-forge\coresrc\apistart.ts:44:9)
at D:\mtgap\node_modules\@electron-forge\clisrc\electron-forge-start.ts:59:19
npm ERR! code ELIFECYCLE
npm ERR! errno 1

To Reproduce

  1. Update Electron to 9
  2. electron-forge start

Additional Information

Looks like node-abi already have Electron 9 support added https://github.com/lgeiger/node-abi/commits/master

Bug

Most helpful comment

Weird. I deleted all node_modules, made clean reinstall and after " npm update --depth 100 node-abi " i got hanging console + NodeJS working in the background with consumption of 100% of 1 CPU core. I kept it running for 30 minutes (!) and it never finished. So probably I'll have to wait until that dependency of Electron forge which has node-abi dependency will get updated, then Forge will get updated and only then my app will get updated :D

Using npm update --depth 100 node-abi didn't work for me, too. CPU usage was very high. I tried using npm update --depth 10 node-abi , which worked for me.

All 12 comments

Please fill out the bug template. Once this happens and we determine it's a bug, I'll reopen this.

Here you go, feel free to re-open and, most importantly, make Forge forging again :)

Use npm update --depth 100 node-abi

node-abi is a transitive dependency of Electron Forge, so there's nothing that can be changed in Forge itself.

"npm update --depth 100 node-abi" didn't worked for me, since process was just hanging when I tried to run this command. Then I installed node-abi as dependency and was able to launch app in dev mode with "electron-forge start" commant. BUT "electron-forge make" still failing with the same error:

"Could not detect abi for version 9.0.0 and runtime electron." on "Preparing native dependencies" step. As I recall, last time when Electron had major update, Electron forge was giving the same error and after Forge update it was fixed. So it's weird you don't admit this to be forge issue, since obviously that without deps update forge is unable to make Electron 9 apps, isn't it?

The point is that node-abi is not a direct dependency, but rather a dependency of a dependency, so Electron Forge cannot force a version update of node-abi, especially since you're using NPM. If the depth option isn't working for you, you'll probably have to remove and reinstall @electron-forge/core from devDependencies.

Weird. I deleted all node_modules, made clean reinstall and after " npm update --depth 100 node-abi " i got hanging console + NodeJS working in the background with consumption of 100% of 1 CPU core. I kept it running for 30 minutes (!) and it never finished. So probably I'll have to wait until that dependency of Electron forge which has node-abi dependency will get updated, then Forge will get updated and only then my app will get updated :D

I got the same error.
I fixed it following this advice
https://github.com/electron-userland/electron-forge/issues/667#issuecomment-460407814

For anyone else that runs into this problem and if you're using yarn: go into yarn.lock file, find entry for node-abi, delete it, then re-run yarn.

Good luck

@asiercamara thanks for sharing. That advice helped me to get things running in dev mode, but "electron-forge make" still failing with the same error.

@Razviar I can't replicate, yarn make (script for "electron-forge make") works for me. I'm using only @electron-forge/maker-squirrel in my electron.config.js

If you're literally running electron-forge make in the shell, then the npm update command (or the equivalent yarn upgrade node-abi) won't work, because you're using the global electron-forge (which you shouldn't be doing, it should be scoped to your project).

@malept thank you so much for pointing me to the right direction. After switching to local forge scoped into the project, all is making fine now and "npm run make" works as a charm. Thanks again for help

Weird. I deleted all node_modules, made clean reinstall and after " npm update --depth 100 node-abi " i got hanging console + NodeJS working in the background with consumption of 100% of 1 CPU core. I kept it running for 30 minutes (!) and it never finished. So probably I'll have to wait until that dependency of Electron forge which has node-abi dependency will get updated, then Forge will get updated and only then my app will get updated :D

Using npm update --depth 100 node-abi didn't work for me, too. CPU usage was very high. I tried using npm update --depth 10 node-abi , which worked for me.

Was this page helpful?
0 / 5 - 0 ratings