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 3.0.1, electron #24

Closed ralphtheninja closed 7 years ago

ralphtheninja commented 7 years ago

Hey. Trying to install the brave browser using npm and get the following warnings. Just want to rubber duck why I get it (it's not crucial for installing)

  SOLINK_MODULE(target) Release/obj.target/sha3.node
  COPY Release/sha3.node
make: Leaving directory '/home/lms/src/browser-laptop/node_modules/sha3/build'

> bufferutil@3.0.0 install /home/lms/src/browser-laptop/node_modules/bufferutil
> prebuild-install || node-gyp rebuild

/home/lms/src/browser-laptop/node_modules/node-abi/index.js:44
  throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '.  Updating "node-abi" might help solve this issue if it is a new release of ' + runtime)
  ^

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

The dependency tree looks like:

lms@x240 ~/src/browser-laptop (master)
$ npm ls node-abi
brave@0.15.3 /home/lms/src/browser-laptop
└─┬ ledger-client@0.9.17
  └─┬ bitgo@2.2.4
    └─┬ secp256k1@3.2.5
      └─┬ prebuild-install@2.1.2
        └── node-abi@2.0.2 
juliangruber commented 7 years ago

3.0.1 definitely isn't a valid electron version. Do they ship with their own electron fork maybe?

ralphtheninja commented 7 years ago

Good question. I haven't taken a deeper look into it. But I reacted to the version number, it looked a bit off :)

TharunKumar1 commented 6 years ago

I am facing similar issue with electron 3.0.4

An unhandled error occurred inside electron-rebuild
Could not detect abi for version 3.0.4 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 3.0.4 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron

How to resolve this ?

jacobq commented 6 years ago

@TharunKumar1 Check which version of node-abi you are using. If you are using the latest (2.4.5) then it should work. I recommend using yarn for this.

$ yarn why node-abi
yarn why v1.10.1
[1/4] Why do we have the module "node-abi"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "node-abi@2.4.3"
info Reasons this module exists
   - "electron-forge#electron-rebuild" depends on it
   - Hoisted from "electron-forge#electron-rebuild#node-abi"
info Disk size without dependencies: "56KB"
info Disk size with unique dependencies: "136KB"
info Disk size with transitive dependencies: "136KB"
info Number of shared dependencies: 1
=> Found "prebuild-install#node-abi@2.4.5"
info This module exists because "my-app#serialport#@serialport#bindings#prebuild-install" depends on it.
info Disk size without dependencies: "56KB"
info Disk size with unique dependencies: "136KB"
info Disk size with transitive dependencies: "136KB"
info Number of shared dependencies: 1
Done in 0.82s.

In my case, (using ember-electron v2.x -> electron-forge v5.x) I resolve this by pinning the version to 2.4.5 via yarn selective resolutions like this:

package.json

  "resolutions": {
    "electron-forge/**/node-abi": "2.4.5"
  },