electron / node-abi

:turtle: :rocket: Get the Node.js and Electron ABI for a given target and runtime
https://www.npmjs.com/node-abi
MIT License
164 stars 58 forks source link

Could not detect abi for version 16.0.0 and runtime electron. Updating "node-abi" might help solve this issue if it is a new release of electron #116

Closed barbalex closed 2 years ago

barbalex commented 2 years ago

After updating an electron app to electron version 16.0.0, when running electron-forge start I get this error:

PS C:\Users\alexa\awel-personal> yarn dev
✔ Checking your system
✔ Locating Application
✖ Preparing native dependencies: 0 / 1

An unhandled error has occurred inside Forge:
Could not detect abi for version 16.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 16.0.0 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron
    at Object.getAbi (C:\Users\alexa\awel-personal\node_modules\node-abi\index.js:36:9)
    at Rebuilder.get ABI [as ABI] (C:\Users\alexa\awel-personal\node_modules\electron-rebuild\src\rebuild.ts:127:33)
    at ModuleRebuilder.get metaData [as metaData] (C:\Users\alexa\awel-personal\node_modules\electron-rebuild\src\module-rebuilder.ts:34:54)
    at ModuleRebuilder.alreadyBuiltByRebuild (C:\Users\alexa\awel-personal\node_modules\electron-rebuild\src\module-rebuilder.ts:40:28)
    at Rebuilder.rebuildModuleAt (C:\Users\alexa\awel-personal\node_modules\electron-rebuild\src\rebuild.ts:264:24)
    at Rebuilder.rebuild (C:\Users\alexa\awel-personal\node_modules\electron-rebuild\src\rebuild.ts:200:9)
    at C:\Users\alexa\awel-personal\node_modules\@electron-forge\core\src\util\rebuild.ts:32:5
MarshallOfSound commented 2 years ago

You need to keep the transitive dependency on node-abi up to date, luckily because you're using yarn this is quite easy.

npx uuaw node-abi

😄

barbalex commented 2 years ago

I tried three things:

  1. installing node_abi (as electron seems to expect it?). Did not work, got error about abi
  2. also installing abi. Still got errors
  3. npx uuaw node-abi. Which produced this error:
    
    PS C:\Users\alexa\awel-personal> npx uuaw node-abi
    Need to install the following packages:
    uuaw
    Ok to proceed? (y) y
    C:\Users\alexa\AppData\Local\npm-cache\_npx\02cd06b8297c5953\node_modules\@yarnpkg\lockfile\index.js:5064
    throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`);
    ^

SyntaxError: Unknown token: { line: 4, col: 2, type: 'INVALID', value: undefined } 4:2 in lockfile at Parser.unexpected (C:\Users\alexa\AppData\Local\npm-cache_npx\02cd06b8297c5953\node_modules\@yarnpkg\lockfile\index.js:5064:11) at Parser.parse (C:\Users\alexa\AppData\Local\npm-cache_npx\02cd06b8297c5953\node_modules\@yarnpkg\lockfile\index.js:5193:14) at parse (C:\Users\alexa\AppData\Local\npm-cache_npx\02cd06b8297c5953\node_modules\@yarnpkg\lockfile\index.js:5262:17) at Object.module.exports.exports.default (C:\Users\alexa\AppData\Local\npm-cache_npx\02cd06b8297c5953\node_modules\@yarnpkg\lockfile\index.js:4835:96) at Object. (C:\Users\alexa\AppData\Local\npm-cache_npx\02cd06b8297c5953\node_modules\uuaw\src\index.js:16:21) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)



I am not quite sure how to go on. Maybe I would have to force using node_abi after installing it? (I forget how it is called but yarn has or used to have a way to do that).