prebuild-install icon indicating copy to clipboard operation
prebuild-install copied to clipboard

How to disable enforced compilation?

Open sebastianrath opened this issue 2 years ago • 1 comments

Hey there,

I am using node-gyp and prebuild-install to build native node modules for an Electron application. The repos of the dependencies don't have the versions prebuilt that I need, so they need to be compiled locally.

However, calling npm install a second time doesn't result in a cache hit. I noticed the --force flag, introduced by https://github.com/prebuild/prebuild-install/pull/48. Where is this set to true?

Any help is highly appreciated!


  • rebuilding native dependencies  [email protected], [email protected] platform=darwin arch=x64
  • install prebuilt binary  name=drivelist version=9.2.4 platform=darwin arch=x64 napi=
  • execute command  command=/usr/local/bin/node /Volumes/FooProject/node_modules/prebuild-install/bin.js --platform=darwin --arch=x64 --target=14.2.8 --runtime=electron --verbose --force
                     workingDirectory=/Volumes/FooProject/node_modules/drivelist
  • build native dependency from sources  name=drivelist
                                          version=9.2.4
                                          platform=darwin
                                          arch=x64
                                          napi=
                                          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.6
    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/sebastian/.npm/_prebuilds/5a2fbc-drivelist-v9.2.4-electron-v89-darwin-x64.tar.gz
    prebuild-install http request GET https://github.com/balena-io-modules/drivelist/releases/download/v9.2.4/drivelist-v9.2.4-electron-v89-darwin-x64.tar.gz
    prebuild-install http 404 https://github.com/balena-io-modules/drivelist/releases/download/v9.2.4/drivelist-v9.2.4-electron-v89-darwin-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=14.2.8 runtime=electron arch=x64 libc= platform=darwin)

sebastianrath avatar Apr 21 '22 03:04 sebastianrath

electron-builder does its own manual invocation of prebuild-install, and is the one setting that flag https://github.com/develar/app-builder/blob/4e2aa6a12e2bc3d31ec0d01d661fb3a4d65248ff/pkg/node-modules/rebuild.go#L220

My guess is that it might need to do that to ensure the correct platform/architecture is installed

Julusian avatar May 07 '22 10:05 Julusian