node-serialport: Some published Prebuild versions have incorrect ABI

Summary of Problem

Im trying to use the prebuild bindaries that are published to provide support for : Multiple plaforms, CPU architectures and versions of electron.

This fails as the ABI versions of the published prebuilts do not match.

Note: this is not regarding the match to a users current runtime Rather there appears to be something incorrect in that

  • for the published version for electron 5.x.x - ABI 70
  • the files inform NodeJS that they are version 47 and thus they cannot be loaded.

Ive found is specifically in the below files , but there may be others as well

File abi file runtime
47 electron-v70-win32-x64\bindings.node electron
47 electron-v70-win32-ia32\bindings.node electron
47 electron-v70-linux-x64/bindings.node electron

Code to Reproduce the Issue

  • download the prebuild for electron 5
npx prebuild-install --runtime electron --target 5.0.10 --arch x64 --platform win32 --tag-prefix @serialport/bindings@ --verbose
prebuild-install info begin Prebuild-install version 5.3.0
prebuild-install info looking for cached prebuild @ C:\Users\josverl\AppData\Roaming\npm-cache\_prebuilds\bde028-bindings-v2.0.8-electron-v70-win32-x64.tar.gz
prebuild-install http request GET https://github.com/node-serialport/node-serialport/releases/download/@serialport/bindings@2.0.8/bindings-v2.0.8-electron-v70-win32-x64.tar.gz
prebuild-install http 200 https://github.com/node-serialport/node-serialport/releases/download/@serialport/bindings@2.0.8/bindings-v2.0.8-electron-v70-win32-x64.tar.gz
prebuild-install info downloading to @ C:\Users\josverl\AppData\Roaming\npm-cache\_prebuilds\bde028-bindings-v2.0.8-electron-v70-win32-x64.tar.gz.16608-da68a1f0e84a4.tmp
prebuild-install info renaming to @ C:\Users\josverl\AppData\Roaming\npm-cache\_prebuilds\bde028-bindings-v2.0.8-electron-v70-win32-x64.tar.gz
prebuild-install info unpacking @ C:\Users\josverl\AppData\Roaming\npm-cache\_prebuilds\bde028-bindings-v2.0.8-electron-v70-win32-x64.tar.gz
prebuild-install info unpack resolved to C:\develop\NodeJS\electron-serialport\node_modules\@serialport\bindings\build\Release\bindings.node
prebuild-install info install Successfully installed prebuilt binary!
VERBOSE: Performing the operation "Copy File" on target "Item: C:\develop\NodeJS\electron-serialport\node_modules\@serialport\bindings\build\Release\bindings.node Destination: C:\develop\NodeJS\electron-serialport\native_modules\@serialport\bindings\lib\binding\node-v70-win32-x64\bindings.node".

then copy native_modules/* --> node_modules 

  • try to load it
const binding= require("node_modules\@serialport\bindings\lib\binding\node-v70-win32-x64\bindings.node")

// or 
const serial = require("serialport")
// internally this uses: 
// bindings = require("bindings")("binding") 
// to try to load the same module

this will throw "

Uncaught Error: The module '\\?\C:\develop\NodeJS\electron-serialport\node_modules\@serialport\bindings\lib\binding\node-v70-win32-x64\bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 47. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

also tried by directly downloading the binding from the published bindings, same problem

the issue also replication on Win32-32 bits and Linux x64, i have not tested on Mac or on Linux ia32 architectures.

relevant stuff

CheckABI Script to simplify testing of ABI versions of Modules

check-ubuntu-x64.txt check-wi32-nx64.txt

Versions, Operating System and Hardware

  • Windows 10, x64
  • Ubuntu 18.04 , x64
  • “serialport”: “^7.1.5”
  • Electron version 5.x.x / ABI 70

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 22 (7 by maintainers)

Most upvoted comments

8.0.3 fixes the problem for me 😃 Thanks!