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.

cannot build native dependency

See original GitHub issue
  • Version: 21.2.0
  • Target: Windows x64

I am trying to package a small project, which has serialport respectively @serialport/bindings. I am developing on macOS (Mojave). The build/packaging for Mac is working fine. The native dependency will be re-built.

When packaging for Windows, I get the following error:

• electron-builder  version=21.2.0 os=18.7.0
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=release/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=@serialport/bindings@2.0.8 platform=win32 arch=x64
  • install prebuilt binary  name=@serialport/bindings version=2.0.8 platform=win32 arch=x64
  ⨯ cannot build native dependency  reason=prebuild-install failed with error and build from sources not possible because platform or arch not compatible
                                    cause=exit status 1
                                    errorOut=prebuild-install info begin Prebuild-install version 5.3.0
    prebuild-install info looking for cached prebuild @ /Users/ph/.npm/_prebuilds/a3ea41-bindings-v2.0.8-electron-v73-win32-x64.tar.gz
    prebuild-install http request GET https://github.com/node-serialport/node-serialport/releases/download/v2.0.8/bindings-v2.0.8-electron-v73-win32-x64.tar.gz
    prebuild-install http 404 https://github.com/node-serialport/node-serialport/releases/download/v2.0.8/bindings-v2.0.8-electron-v73-win32-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=6.0.7 runtime=electron arch=x64 libc= platform=win32)
    
                                    command=/usr/local/Cellar/node/12.8.0/bin/node /Users/ph/Documents/Project/node_modules/prebuild-install/bin.js --platform=win32 --arch=x64 --target=6.0.7 --runtime=electron --verbose --force
                                    workingDir=/Users/ph/Documents/Project/node_modules/@serialport/bindings
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I tried to package for Linux also for testing purpose, but I got the same error. I can only package for macOS.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

28reactions
defusionercommented, Sep 2, 2019

@phhoef obviously you’ve got 404: prebuild-install http 404 https://github.com/node-serialport/node-serialport/releases/download/v2.0.8/bindings-v2.0.8-electron-v73-win32-x64.tar.gz

Try disabling rebuild by adding "npmRebuild": false, to your build config.

1reaction
defusionercommented, Sep 2, 2019

@phhoef Can’t get you more help right now, sorry, I’ve got the same 404 problem (but for another dependency) and resolved it with no reinstall flag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron cannot build platform dependencies fsevents and/or ...
To successfully run the app locally I had to rebuild them using ./node_modules/.bin/electron-rebuild -p -t "dev,prod,optional" And now when I ...
Read more >
Blazor .NET 6 with Native Dependency cannot build without ...
NET 6 with Native Dependency cannot build without administrator permission. ... started as administrator in order to build the project with native bindings....
Read more >
Building a Native Executable - Quarkus
To do this run ./mvnw test-compile failsafe:integration-test -Pnative . This will discover the existing native image and run the tests against it using...
Read more >
Add build dependencies - Android Developers
As of Android Gradle plugin 4.0, native dependencies can also be imported in the manner described in this document. Depending on an AAR...
Read more >
Native Node Modules | Electron
# Tell node-pre-gyp to build module from source code. export npm_config_build_from_source=true # Install all dependencies, and store cache to ~/.electron-gyp.
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