question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong prebuilt binary target for native dependency

See original GitHub issue
  • Node: 13.2.0

  • Version: 22.7.0

  • Electron Version: 9.0.5

  • Electron Type (current, beta, nightly): current

  • Target: win/nsis

  • serialport: 9.0.0

I’ve been unable to successfully integrate the serialport npm module into my build. Here is my build configuration and script in my package.json:

  "scripts": {
    "start": "electron .",
    "build": "npm-run-all --parallel build:main build:renderer",
    "build:main": "webpack --config ./webpack.config.main.js --mode production",
    "build:renderer": "webpack --config ./webpack.config.renderer.js --mode production",
    "pack": "npm run-script build && electron-builder --dir",
    "dist": "npm run-script build && electron-builder"
  },
  "build": {
    "appId": "my_app",
    "files": [
      "build/**/*",
      "node_modules/**/*"
    ]
  }

the result of my “dist” script:

  • build native dependency from sources  name=@serialport/bindings
                                          version=9.0.0
                                          platform=win32
                                          arch=x64
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 5.3.4
    prebuild-install WARN install prebuilt binaries enforced with --force!
    prebuild-install WARN install prebuilt binaries may be out of date!
    prebuild-install info looking for cached prebuild @ C:\Users\Me\AppData\Roaming\npm-cache\_prebuilds\90024b-bindings-v9.0.0-electron-v80-win32-x64.tar.gz
    prebuild-install http request GET https://github.com/serialport/node-serialport/releases/download/@serialport/bindings@9.0.0/bindings-v9.0.0-electron-v80-win32-x64.tar.gz
    prebuild-install http 404 https://github.com/serialport/node-serialport/releases/download/@serialport/bindings@9.0.0/bindings-v9.0.0-electron-v80-win32-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=9.0.5 runtime=electron arch=x64 libc= platform=win32)

Now it seems to me that the target would be the v83 build since that corresponds to the chrome version used in electron’s 9.0.5 release and there is a v83 release of the serialport prebuilt binary in their releases, there is no v80 release. I do not know how electron-builder knows which release version to target or if this is a configuration issue with the serialport module. Should I be using an earlier version of electron/serialport? I have yet to try and put a re-named binary into that cache location.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
nick318commented, Aug 18, 2020

I had similar issue with old serialport dependency, so here is my setup which works:

  • Node: 12.18.3
  • Electron builder: 22.8.0
  • Electron: 9.1.1
  • Serialport: 9.0.1
  • Nodeabi: 2.18.0
0reactions
andypotatocommented, Jan 16, 2021

This issue still exists in electron-builder 22.9.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot build native dependency reason=prebuild-install failed ...
Describe the bug When i try to pack a .exe with arch32 and arch 'x64' on my macbook, i got an error: cannot...
Read more >
Electron-Builder installing wrong prebuild for native ...
I have yet to try and manually install the prebuilt binary into that local cache location. However, I do not know how or...
Read more >
Prebuilt ABI Usages Checker | Android Open Source Project
The checker links the prebuilt binary with the dependencies of the prebuilt binary and checks whether all undefined symbols are resolved. First, ...
Read more >
C / C++ Rules - Bazel
Each string in this attribute is added in the given order to COPTS before compiling the binary target. The flags take effect only...
Read more >
Building the JDK - OpenJDK
To build Linux binaries, you must use a Linux boot JDK. ... JDK consists of native code, that needs to be compiled to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found