node-serialport: prebuild-install via electron-builder gets 404 when downloading windows bindings (but not Mac)

When attempting to build electron with electron-build for windows via the docker image, there’s an issue with getting a 404 when attempting to load the windows bindings from GitHub. The Mac version builds just fine, as does linux from the Docker image.

In Docker, If I manually download the bindings from the releases the copy the file name it missed (eg the has-prefixed filename) into _prebuilds folder, it builds fine. It appears to use the prebuilt binary on the Mac side as well.

    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 @ /Users/XXXXXX/.npm/_prebuilds/ac1814-bindings-v8.0.4-electron-v75-win32-x64.tar.gz
    prebuild-install http request GET https://github.com/serialport/node-serialport/releases/download/v8.0.4/bindings-v8.0.4-electron-v75-win32-x64.tar.gz
    prebuild-install http 404 https://github.com/serialport/node-serialport/releases/download/v8.0.4/bindings-v8.0.4-electron-v75-win32-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=7.1.1 runtime=electron arch=x64 libc= platform=win32)

Is there something missing in the prerebuild configuration where its looking for the wrong URL or something?

Any help would be greatly appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 10
  • Comments: 21 (9 by maintainers)

Most upvoted comments

Hi, I run into the same issue because version 8 of Electron uses NODE_MODULE_VERSION 76 and most recent serialport release is for version 75. Here’s the output from electron-builder

prebuild-install http request GET https://github.com/serialport/node-serialport/releases/download/@serialport/bindings@8.0.7/bindings-v8.0.7-electron-v76-linux-x64.tar.gz
prebuild-install http 404 https://github.com/serialport/node-serialport/releases/download/@serialport/bindings@8.0.7/bindings-v8.0.7-electron-v76-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=8.0.0 runtime=electron arch=x64 libc= platform=linux)

To make it work I downgraded my app to version 7.1.12 of electron but I made this post to informs core developers of the problem.

No reason but my day job keeping me busy.

Successfully published:

let me know how it works

Looking at the URLs that are requested, prebuild-install seems to be looking for a release called v8.0.4, however the release in this repo with the artifacts is called @serialport/bindings@8.0.4.

I’m not sure if this is something that can be easily fixed on the side of the serialport team, however I used the following manual workaround:

  1. Look at the logged output. The following information is important:
    1. the line ‘looking for cached prebuild @’ note the path following the @-sign
    2. the line ‘request GET’ note the filename at the end of the URL.
  2. Download the file from the correct URL to the location from step 1. I used curl
curl -L "https://github.com/serialport/node-serialport/releases/download/%40serialport%2Fbindings%408.0.4/$FILENAME" -o "$PATH_TO_CACHED"

Per https://github.com/serialport/node-serialport/issues/2031#issuecomment-626324067 serialport@9 now ships with ABI v76 for electron

And just to note @mkurczewski getting it building probably took about 8 hours of work, the ecosystem is super brittle, I’m thankful for you raising the issues, but I want you to know what goes into it.

For anyone who finds this thread and wants to know how to build the binaries themselves. See https://github.com/serialport/node-serialport/issues/2031#issuecomment-616551473

Electron remains a pain to support but it’s obviously a wonderful use case. If anyone wants to help make it easier to use with serialport, please consider updating the documents and contributing to https://github.com/serialport/website/blob/master/docs/guide-installation.md#electron

Hi @reconbot, what’s the approximate date when we can see the update for Electron 8?