Electron-builder: mac build fails when rebuilding native dependencies

Created on 4 Nov 2018  Â·  1Comment  Â·  Source: electron-userland/electron-builder



The issue was first encountered on v20.26.1. Upgrading to 20.31.2 makes no difference and produces the same error.


Building all platforms but mac is the one suddenly failing.



We have Travis setup to automatically build binaries for all platforms; which worked fine up to and including October 10th. After that our next release was on October 24th at which point the mac target failed to build. Both builds use xcode 8.3, node v9.11.2; npm v6.4.1, electron v2.0.6 and electron-builder v20.26.1.

The working build says 'no native dependencies' and then proceeds to build:

> build -p never
  • electron-builder version=20.26.1
  • loaded configuration file=package.json ("build" field)
  • no native production dependencies
  • packaging       platform=darwin arch=x64 electron=2.0.6 appOutDir=build/binaries/mac
  • downloading               parts=4 size=49 MB url=https://github.com/electron/electron/releases/download/v2.0.6/electron-v2.0.6-darwin-x64.zip
  • downloading               parts=1 size=5.3 kB url=https://github.com/electron/electron/releases/download/v2.0.6/SHASUMS256.txt

The failing build for some reason needs to rebuild native dependencies and fails while doing so:

> build -p never
  • electron-builder version=20.26.1
  • loaded configuration file=package.json ("build" field)
  • rebuilding native production dependencies platform=darwin arch=x64
Error: /Users/travis/.nvm/versions/node/v9.11.2/bin/node exited with code 1
Output:
> [email protected] install /Users/travis/build/bitshares/bitshares-ui/node_modules/fsevents
> node install
  SOLINK_MODULE(target) Release/.node
Failed to execute '/Users/travis/.nvm/versions/node/v9.11.2/bin/node /Users/travis/.nvm/versions/node/v9.11.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/travis/build/bitshares/bitshares-ui/node_modules/fsevents/lib/binding/Release/electron-v2.0-darwin-x64/fse.node --module_name=fse --module_path=/Users/travis/build/bitshares/bitshares-ui/node_modules/fsevents/lib/binding/Release/electron-v2.0-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)
Error output:
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-electron-v2.0-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (electron-v2.0 ABI, unknown) (falling back to source compile with node-gyp) 
make: g++-4.8: No such file or directory
make: *** [Release/.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/travis/.nvm/versions/node/v9.11.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)

Any ideas as to what the cause is and how to fix it?

Most helpful comment

Figured out the cause which was another package which had npm-watch incorrectly listed in dependencies instead of devDependencies, and npm-watch depends on nodemon which requires building. Moving npm-watch to devDependencies resolved the issue.

>All comments

Figured out the cause which was another package which had npm-watch incorrectly listed in dependencies instead of devDependencies, and npm-watch depends on nodemon which requires building. Moving npm-watch to devDependencies resolved the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philcockfield picture philcockfield  Â·  3Comments

xingoxu picture xingoxu  Â·  3Comments

lbssousa picture lbssousa  Â·  3Comments

leo picture leo  Â·  3Comments

iklemm picture iklemm  Â·  3Comments