20.26.0 ( latest )
MacOS - DMG , Windows - Squirrel ( Windows build passes, MacOS build fails)
I'm having the same issue as was brought up here https://github.com/electron-userland/electron-builder/issues/3039 , The MacOS build fails with EEXIST: file already exists, below is a sample of the error, there are more similar errors in the error log. This only happens on the CI (Bitrise) , if I run the build on a local machine it works perfectly, this also only seems to affect MacOS, Windows local & CI builds work perfectly.
electron-builder version=20.26.0
• artifacts will be published reason=tag is defined tag=0.33.0-pre3
• loaded configuration file=package.json ("build" field)
• skipped app dependencies rebuild reason=npmRebuild is set to false
• packaging platform=darwin arch=x64 electron=2.0.5 appOutDir=dist/mac
• downloading parts=4 size=49 MB url=https://github.com/electron/electron/releases/download/v2.0.5/electron-v2.0.5-darwin-x64.zip
• downloading parts=1 size=5.3 kB url=https://github.com/electron/electron/releases/download/v2.0.5/SHASUMS256.txt
• asar using is disabled — it is strongly not recommended solution=enable asar and use asarUnpack to unpack files that must be externally available
Error: Cannot cleanup:
Error #1 --------------------------------------------------------------------------------
Error: EEXIST: file already exists, link '/Users/vagrant/git/node_modules/electron-remote/node_modules/debug/LICENSE' -> '/Users/vagrant/git/client/dist/mac/Electron.app/Contents/Resources/app/node_modules/debug/LICENSE'
at copyOrLinkFile (/Users/vagrant/git/node_modules/builder-util/src/fs.ts:182:12)
at /Users/vagrant/git/node_modules/builder-util/src/fs.ts:257:11
at Generator.next (<anonymous>)
From previous event:
at FileCopier.copy (/Users/vagrant/git/node_modules/builder-util/src/fs.ts:235:64)
at /Users/vagrant/git/node_modules/app-builder-lib/src/util/appFileCopier.ts:70:13
at Generator.next (<anonymous>)
at xfs.stat (/Users/vagrant/git/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
at /Users/vagrant/git/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:154:5)
From previous event:
at copyAppFiles (/Users/vagrant/git/node_modules/app-builder-lib/out/util/appFileCopier.js:260:17)
at taskManager.addTask._bluebirdLst.default.each.it (/Users/vagrant/git/node_modules/app-builder-lib/src/platformPackager.ts:292:86)
From previous event:
at MacPackager.copyAppFiles (/Users/vagrant/git/node_modules/app-builder-lib/src/platformPackager.ts:292:43)
at /Users/vagrant/git/node_modules/app-builder-lib/src/platformPackager.ts:209:10
at Generator.next (<anonymous>)
at runCallback (timers.js:781:20)
at tryOnImmediate (timers.js:743:5)
at processImmediate [as _immediateCallback] (timers.js:714:5)
From previous event:
at MacPackager.doPack (/Users/vagrant/git/node_modules/app-builder-lib/src/platformPackager.ts:157:165)
at /Users/vagrant/git/node_modules/app-builder-lib/src/macPackager.ts:88:63
at Generator.next (<anonymous>)
From previous event:
at MacPackager.pack (/Users/vagrant/git/node_modules/app-builder-lib/src/macPackager.ts:80:95)
at /Users/vagrant/git/node_modules/app-builder-lib/src/packager.ts:376:24
at Generator.next (<anonymous>)
at xfs.mkdir.er (/Users/vagrant/git/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:37:14)
at FSReqWrap.oncomplete (fs.js:136:15)
From previous event:
at Packager.doBuild (/Users/vagrant/git/node_modules/app-builder-lib/src/packager.ts:344:39)
at /Users/vagrant/git/node_modules/app-builder-lib/src/packager.ts:314:57
From previous event:
at Packager._build (/Users/vagrant/git/node_modules/app-builder-lib/src/packager.ts:285:133)
at /Users/vagrant/git/node_modules/app-builder-lib/src/packager.ts:281:23
at Generator.next (<anonymous>)
at runCallback (timers.js:781:20)
at tryOnImmediate (timers.js:743:5)
at processImmediate [as _immediateCallback] (timers.js:714:5)
From previous event:
at Packager.build (/Users/vagrant/git/node_modules/app-builder-lib/src/packager.ts:238:14)
at build (/Users/vagrant/git/node_modules/app-builder-lib/src/index.ts:58:28)
at build (/Users/vagrant/git/node_modules/electron-builder/src/builder.ts:227:10)
at then (/Users/vagrant/git/node_modules/electron-builder/src/cli/cli.ts:42:48)
at <anonymous>
Set env USE_HARD_LINKS=false as workaround.
Is it possible to provide project or sample to reproduce (locally you can reproduce using env USE_HARD_LINKS=true)?
Thanks for the reply @develar , Setting the env variable works 👍
I can't provide the project, its on a private repo, but I've made a quick sample app using the same dependencies as the app that has the problem
https://github.com/smithalan92/electron-builder-sample-error-app
npm i in the root and in ./src and then npm run build and the error will happen
@smithalan92 @develar Where do you set the USE_HARD_LINKS env variable? I am also facing the same issue with electron-builder 20.43.0 while building on mac
For now I created a file named electron-builder.env and put it in there.
@snene For Windows it needs to be set in System Environment Variables, for MacOS it needs to go in your ~/.bashrc or ~/.bash_profile file ( see here
Thanks a bunch for the prompt reply @smithalan92
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Set env
USE_HARD_LINKS=falseas workaround.