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

Missing Latest Electron Version (25.1.1) #140

Closed probably-not closed 1 year ago

probably-not commented 1 year ago

When upgrading to electron 25.1.1:

Could not detect abi for version 25.1.1 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron
probably-not commented 1 year ago

It looks like this is related to an issue around here: https://github.com/electron/node-abi/blob/main/scripts/update-abi-registry.js#L69

The electron version 25.1.1 is in the electron version response, but for some reason an alpha version is what is in the versionsByModules value at the end.

probably-not commented 1 year ago

This seems to be caused by an issue in the sorting for the electron versions. The new sort functions introduced in #139 sorted the electron versions in a descending order, so when the reduce function runs, it ends up reducing the electron version to the earliest released version per major+modules version combination.

probably-not commented 1 year ago

Following conversation in the PR, the sorting is likely correct and #139 hasn't shipped yet so there's no issue there, but there still seems to be some sort of issue (not sure what it is yet, seems to happen when trying to upgrade electron and electron-forge?)...

Adding the relevant details from the PR here:

package.json contains the latest versions of forge and electron:

  "devDependencies": {
    "@electron-forge/cli": "^6.2.1",
    "@electron-forge/maker-appx": "^6.2.1",
    "@electron-forge/maker-deb": "^6.2.1",
    "@electron-forge/maker-pkg": "^6.2.1",
    "@electron-forge/maker-rpm": "^6.2.1",
    "@electron-forge/maker-squirrel": "^6.2.1",
    "@electron-forge/maker-zip": "^6.2.1",
    "@electron-forge/plugin-webpack": "^6.2.1",
    "@electron-forge/publisher-s3": "^6.2.1",
    "@electron/rebuild": "^3.2.13",
    "electron": "25.1.1",
    "node-abi": "^3.45.0"
  }

We are continuously seeing the "could not detect abi" error while running any sort of rebuild.

We are trying to upgrade to the latest electron and forge versions and this is just blocking the upgrade for some reason.

MarshallOfSound commented 1 year ago

@probably-not You shouldn't be adding a top level dependency for node-abit, that doesn't help (it actually just obscures the issue). You need to ensure that the transitive node-abit dependency is updated.

Either via npm npm update node-abi --depth=100 or yarn npx uuaw@latest node-abi

probably-not commented 1 year ago

@MarshallOfSound If this is the case, I believe the issue here is the error message... It says to update node-abi, but doesn't say that it can't be a top level dependency and that the update needs to update the transitive dependency without adding a top level dependency.

Can I open a PR to fix this error message so that it's clear how to solve the issue?