Electron-builder: at least snapcraft 2.40.0 ... unable to build snap

Created on 15 Dec 2018  Â·  8Comments  Â·  Source: electron-userland/electron-builder

  • Version: 20.38.3
  • Target: snap
    Hi,

When trying to build a snap package come the error

⨯ at least snapcraft 2.40.0 is required, please: sudo snap install snapcraft --classic

of course snapcraft is installed and in version > 3.0

here is the complete log
Hope you can find the source of the error, perhaps it comes from me but it appeared suddenly and I can't find why
I was thinking of a mistake in the version comparison when upgrading to > 3.0


• building        target=snap arch=x64 file=dist/Carnet_0.10.2_amd64.snap
  ⨯ at least snapcraft 2.40.0 is required, please: sudo snap install snapcraft --classic
Error: /home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-bin/linux/x64/app-builder exited with code 1
    at ChildProcess.childProcess.once.code (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/builder-util/src/util.ts:244:14)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
From previous event:
    at SnapTarget.build (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/targets/snap.ts:148:44)
    at Function.buildAsyncTargets (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/platformPackager.ts:140:36)
    at LinuxPackager.packageInDistributableFormat (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/platformPackager.ts:119:24)
    at /home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/platformPackager.ts:114:10
From previous event:
    at LinuxPackager.pack (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/platformPackager.ts:111:95)
    at /home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/packager.ts:430:24
    at Generator.next (<anonymous>)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at Packager.doBuild (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/packager.ts:396:24)
    at /home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/packager.ts:366:57
    at Generator.next (<anonymous>)
    at /home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/graceful-fs/graceful-fs.js:111:16
    at /home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
    at Packager._build (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/packager.ts:335:133)
    at /home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/packager.ts:331:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at Packager.build (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/packager.ts:288:14)
    at build (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/app-builder-lib/src/index.ts:59:28)
    at build (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/electron-builder/src/builder.ts:227:10)
    at then (/home/phie/Dev/GitBis/QuickDoc/CarnetNextcloud/templates/CarnetElectron/node_modules/electron-builder/src/cli/cli.ts:46:19)
    at <anonymous>

Thanks !

bug snap

Most helpful comment

Hi, it doesn't seem to work with snapcraft 3.0.1, I still have the same issue

perhaps it comes from my side

thanks again for your work and merry christmas

All 8 comments

Hi, it doesn't seem to work with snapcraft 3.0.1, I still have the same issue

perhaps it comes from my side

thanks again for your work and merry christmas

@PhieF I think you'll need to wait for a release containing this fix to appear: https://github.com/develar/app-builder/commit/fb63683b7d133ced2a39b265680cddf1a0f50d50

EDIT: nevermind, I see this issue on my side even after upgrading to 20.38.4 which does have the fix. I'm stuck on snap 2.36.3 on Ubuntu 18.04 but I'm not able to upgrade to a newer version.

$ snap version
snap    2.36.3
snapd   2.36.3
series  16
ubuntu  18.04
kernel  4.15.0-43-generic

This is despite my snapcraft package being up-to-date:

$ snap list snapcraft
Name       Version  Rev   Tracking  Publisher   Notes
snapcraft  3.0.1    2374  stable    canonical✓  classic

@develar is the check here that electron-builder requires looking at the right value?

I'm not sure the latest electron-builder has the right fix, because I still see the old error when I try and build a snap:

$ snapcraft --version
snapcraft, version 3.0.1

$ yarn list --pattern app-builder-bin
yarn list v1.12.3
└─ [email protected]
Done in 1.02s.

$ yarn run package
yarn run v1.12.3
$ ts-node -P script/tsconfig.json script/package.ts
  • electron-builder version=20.38.4
  • loaded configuration file=/home/parallels/src/desktop/script/electron-builder-linux.yml
  • writing effective config file=dist/builder-effective-config.yaml
  • building        target=snap arch=x64 file=dist/GitHubDesktop-linux-1.5.2-beta0.snap
  • building        target=AppImage arch=x64 file=dist/GitHubDesktop-linux-1.5.2-beta0.AppImage
  ⨯ at least snapcraft 2.40.0 is required, please: sudo snap install snapcraft --classic
Error: /home/parallels/src/desktop/node_modules/app-builder-bin/linux/x64/app-builder exited with code 1
    ...

That error looks like the old message, not the new message that contains the version it found.

Seems to work, now... Perhaps when I've updated to electron v3

I am still experiencing this issue on version 20.38.4. I'm not sure exactly what snapcraft is doing for the default build process? Is it required to produce packaged for Linux? Is there a way around it? Literally same situation as the OP.

@Cyntaax, I am having the same issue. Do we have a way around this, or a way to easily revert snapcraft to 2.40.0 to see if that is the problem?

Please read over #3600 as I think there's been a packaging issue with the latest version of electron-builder that affects this bug.

No longer getting this error after adding -c.snap.publish=github to my electron-builder command (although not helpful if you're trying to publish to Snap Store)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noahprince22 picture noahprince22  Â·  3Comments

omarkilani picture omarkilani  Â·  3Comments

iklemm picture iklemm  Â·  3Comments

talarari picture talarari  Â·  3Comments

JohnWeisz picture JohnWeisz  Â·  3Comments