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.

Release for ubuntu fails due to snapcraft is not installed

See original GitHub issue

Describe the bug First, I just want to say thank you so much for this fantastic template! I was using the Vue CLI Plugin Electron Builder, but it’s not as up-to-date or as awesome as Vite, and this template made converting to Vite a breeze.

Now for the issue: the only change I made to the release.yml was as per the comment:

    #    To compile the application for different platforms, use:
    #    os: [ macos-latest, ubuntu-latest, windows-latest ]

I made that change as I’m wanting to release for all platforms, and now the release fails for ubuntu-latest. It still creates the app image perfectly, but crashes at the snap store. (I believe you can check the failed action here: https://github.com/ste163/vislit/runs/3794128439?check_suite_focus=true)

To Reproduce

  1. Change your release.yml’s OS line 87 to [ macos-latest, ubuntu-latest, windows-latest ]
  2. Push to main
  3. Ubuntu should fail due snapcraft not being installed. Mac and Windows should build just fine

Expected behavior The release should build for the snap store; however, I don’t really need it. I’m good with just having the app image.

Screenshots Error message:

Error: Command failed: npx --no-install electron-builder --linux --publish always --config electron-builder.config.js
  • electron-builder  version=22.11.7 os=5.8.0-1042-azure
  • loaded configuration  file=/home/runner/work/vislit/vislit/electron-builder.config.js
  • description is missed in the package.json  appPackageFile=/home/runner/work/vislit/vislit/package.json
  • author is missed in the package.json  appPackageFile=/home/runner/work/vislit/vislit/package.json
  • packaging       platform=linux arch=x64 electron=15.1.0 appOutDir=dist/linux-unpacked
  • building        target=snap arch=x64 file=dist/vislit_21.10.4-1033_amd64.snap
  • building        target=AppImage arch=x64 file=dist/vislit-21.10.4-1033.AppImage
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • publishing      publisher=Github (owner: ste163, project: vislit, version: 21.10.4-1033)
  • uploading       file=vislit-21.10.4-1033.AppImage provider=GitHub
  • overwrite published file  file=vislit-21.10.4-1033.AppImage reason=already exists on GitHub
  • publishing      publisher=Snap Store
  • uploading       file=vislit_21.10.4-1033_amd64.snap provider=snapStore
  ⨯ snapcraft is not installed, please: sudo snap install snapcraft --classic  
  ⨯ /home/runner/work/vislit/vislit/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  failedTask=build stackTrace=Error: /home/runner/work/vislit/vislit/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
    at ChildProcess.<anonymous> (/home/runner/work/vislit/vislit/node_modules/builder-util/src/util.ts:249:14)
    at Object.onceWrapper (node:events:510:26)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:144
				throw err;
				^

Error: Command failed: npx --no-install electron-builder --linux --publish always --config electron-builder.config.js
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at run (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:21:27)
    at runAction (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:132:4)
    at Object.<anonymous> (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:150:1)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 2006,
  stdout: null,
  stderr: null
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ste163commented, Oct 5, 2021

Adding the following to electron-builder.config.js ‘fixed’ the issue as it no longer targets snap:

linux: {
  target: "AppImage"
}

When I get to the point where my app is ready for release, I’ll check into get snap working.

Thanks for all your help!

0reactions
ste163commented, Oct 4, 2021

Awesome, will check those out! Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Snapcraft documentation
Network access, Empty response from the server. Connection refused error, Slow snap downloads. Missing binaries, Home directory location.
Read more >
Your system is unable to reach the snap store - Ask Ubuntu
So do sudo apt-get remove lxd lxd-client . And note that the system not being able ot reach Snapcraft means that underlying in...
Read more >
Can't install Snapcraft - Build Environment - CircleCI Discuss
I've been following https://blog.ubuntu.com/2017/06/28/build-test-and- ... /bin/bash: snapcraft: command not found Exited with code 127.
Read more >
How to Install Snapcraft on Ubuntu or CentOS - Liquid Web
Step 1: Install snapd · Step 2: Enable Snap.socket · Step 3: Enable classic Snap support · Step 4: Install Snapcraft · Install...
Read more >
store: Installing a snap with no stable provides wrong ... - GitHub
If you open https://snapcraft.io/node can click on install and it suggests a normal install, but it fails. This is because node has no...
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