This issue is happening on Ubuntu 20.04. My .DEB builds fine, but .SNAP has an issue.
Almost like what I've seen here -> https://github.com/electron-userland/electron-forge/issues/1607
{
"name": "@electron-forge/maker-snap",
"config": {
"name": "xxx",
"version": "1.0.0",
"appConfig":{
"base": "core18"
},
"features": {
"audio": true,
"mpris": "com.xxx.xxx",
"webgl": true
},
"summary": "xxx",
"description": "xxx"
}
}
An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/home/xxx/xxx.snap
Error: Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/home/xxx/xxx.snap
at ChildProcess.<anonymous> (/home/xxx/xxx/node_modules/@malept/cross-spawn-promise/src/index.ts:155:16)
at ChildProcess.emit (events.js:310:20)
at ChildProcess.EventEmitter.emit (domain.js:482:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
Please fill out the bug template so that the problem can be diagnosed easier.
name: make-snap Issue
about: Issue with @electron-forge/maker-snap
this - > Developers shouldn't have to worry about setting up build tooling, native module rebuilding, etc. Everything should "just work" for them out of the box.
I expected it to work just like @electron-forge/maker-deb did.
look at the initial post.
Terminal:
xxx@xxx: ~/.../yurjo-news$ electron-forge importβ Checking your system
β Initializing Git Repository
It looks like this project is already configured for Electron Forge
β Writing modified package.json file
β Installing dependencies
β Writing modified package.json file
β Fixing .gitignore
We have ATTEMPTED to convert your app to be in a format that electron-forge understands.
Thanks for using "electron-forge"!!!
xxx@xxx:~/.../yurjo-news$ npm install --save-dev @electron-forge/maker-snap
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN rm not removing /..../yurjo-news/node_modules/.bin/rimraf as it wasn't installed by /.../yurjo-news/node_modules/rimraf
npm WARN rm not removing /.../yurjo-news/node_modules/.bin/semver as it wasn't installed by /.../yurjo-news/node_modules/semver
[email protected] postinstall /.../yurjo-news/node_modules/core-js
node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
https://opencollective.com/core-js
https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
18 packages are looking for funding
run npm fund for details
found 1 low severity vulnerability
run npm audit fix to fix them, or npm audit for details
xxx@xxx:~/.../yurjo-news$ npm run make
[email protected] make /.../yurjo-news
electron-forge make
β Checking your system
β Resolving Forge Config
We need to package your application before we can make it
β Preparing to Package Application for arch: x64
β Preparing native dependencies
β Packaging Application
Making for the following targets: deb, snap
β Making for target: deb - On platform: linux - For arch: x64
β Making for target: snap - On platform: linux - For arch: x64The browser-sandbox feature will trigger a manual review in the Snap store.
β Making for target: snap - On platform: linux - For arch: x64
An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/.../yurjo-news/out/make/snap/x64/yurjo-news_1.0.0_amd64.snap
Error: Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/.../yurjo-news/out/make/snap/x64/yurjo-news_1.0.0_amd64.snap
at ChildProcess.
at ChildProcess.emit (events.js:310:20)
at ChildProcess.EventEmitter.emit (domain.js:482:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] make: electron-forge make
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] make script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /.../.npm/_logs/2020-05-02T18_43_10_524Z-debug.log
It would help greatly if you could rerun your command as DEBUG=electron-installer-snap:snapcraft npm run make and paste the output here.
xxx@xxx:~/.../Electron/yurjo-news$ npm run make
> [email protected] make /.../Electron/yurjo-news
> electron-forge make
β Checking your system
β Resolving Forge Config
An unhandled rejection has occurred inside Forge:
Error: Could not find module with name: @electron-forge/maker-snap. Make sure it's listed in the devDependencies of your package.json
at _default (/.../Electron/yurjo-news/node_modules/@electron-forge/core/src/api/make.ts:125:15)
at /.../Electron/yurjo-news/node_modules/@electron-forge/cli/src/electron-forge-make.ts:44:5
Electron Forge was terminated. Location:
{}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] make: `electron-forge make`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] make script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /.../.npm/_logs/2020-05-28T14_33_29_679Z-debug.log
xxx@xxx:~/.../Electron/yurjo-news$ electron-forge importβ Checking your systemβ Initializing Git RepositoryIt looks like this project is already configured for Electron Forgeβ Writing modified package.json file
β Installing dependencies
β Writing modified package.json file
β Fixing .gitignore
We have ATTEMPTED to convert your app to be in a format that electron-forge understands.
Thanks for using "electron-forge"!!!
xxx@xxx:~/.../Electron/yurjo-news$ npm install --save-dev @electron-forge/maker-snapnpm WARN rm not removing /.../Electron/yurjo-news/node_modules/.bin/rimraf as it wasn't installed by /.../Electron/yurjo-news/node_modules/rimrafnpm WARN rm not removing /.../Electron/yurjo-news/node_modules/.bin/semver as it wasn't installed by /.../Electron/yurjo-news/node_modules/semver
> [email protected] postinstall /.../Electron/yurjo-news/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
> [email protected] postinstall /.../Electron/yurjo-news/node_modules/electron
> node install.js
npm WARN [email protected] No repository field.
+ @electron-forge/[email protected]
added 10 packages from 1 contributor, removed 19 packages, updated 472 packages and audited 482 packages in 14.398s
18 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
xxx@xxx:~/.../Electron/yurjo-news$ npm audit fix
npm ERR! code ELOCKVERIFY
npm ERR! Errors were found in your package-lock.json, run npm install to fix them.
npm ERR! Missing: @electron-forge/[email protected]
npm ERR! A complete log of this run can be found in:
npm ERR! /.../.npm/_logs/2020-05-28T14_37_40_195Z-debug.log
xxx@xxx:~/.../Electron/yurjo-news$ DEBUG=electron-installer-snap:snapcraft
xxx@xxx:~/.../Electron/yurjo-news$ npm audit fixnpm ERR! code ELOCKVERIFY
npm ERR! Errors were found in your package-lock.json, run npm install to fix them.
npm ERR! Missing: @electron-forge/[email protected]
npm ERR! A complete log of this run can be found in:
npm ERR! /.../.npm/_logs/2020-05-28T14_37_46_666Z-debug.log
xxx@xxx:~/.../Electron/yurjo-news$ npm install
npm WARN [email protected] No repository field.
added 1 package from 1 contributor, removed 1 package and audited 483 packages in 2.963s
18 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
xxx@xxx:~/.../Electron/yurjo-news$ DEBUG=electron-installer-snap:snapcraft
xxx@xxx:~/.../Electron/yurjo-news$ npm run make
> [email protected] make /.../Electron/yurjo-news
> electron-forge make
β Checking your system
β Resolving Forge Config
We need to package your application before we can make it
β Preparing to Package Application for arch: x64
β Preparing native dependencies
β Packaging Application
Making for the following targets: deb, snap, zip
β Making for target: deb - On platform: linux - For arch: x64
β Making for target: snap - On platform: linux - For arch: x64The browser-sandbox feature will trigger a manual review in the Snap store.
β Making for target: snap - On platform: linux - For arch: x64
An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/.../Electron/yurjo-news/out/make/snap/x64/yurjo-news_1.0.0_amd64.snap
Error: Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/.../Electron/yurjo-news/out/make/snap/x64/yurjo-news_1.0.0_amd64.snap
at ChildProcess.<anonymous> (/.../Electron/yurjo-news/node_modules/@malept/cross-spawn-promise/src/index.ts:155:16)
at ChildProcess.emit (events.js:310:20)
at ChildProcess.EventEmitter.emit (domain.js:482:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] make: `electron-forge make`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] make script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /.../.npm/_logs/2020-05-28T14_40_02_308Z-debug.log
If you're going to split DEBUG=electron-installer-snap:snapcraft into its own line, you need to run this instead:
export DEBUG=electron-installer-snap:snapcraft
npm run make
I still get an error.
β Έ Making for target: snap - On platform: linux - For arch: x64Setting target machine to 'amd64'
Issues while validating snapcraft.yaml: The 'apps/yurjo-news' property does not match the required schema: Additional properties are not allowed ('base' was unexpected)
β Making for target: snap - On platform: linux - For arch: x64
An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/.../Electron/yurjo-news/out/make/snap/x64/yurjo-news_1.0.0_amd64.snap
Error: Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/.../Electron/yurjo-news/out/make/snap/x64/yurjo-news_1.0.0_amd64.snap
at ChildProcess.<anonymous> (/.../Electron/yurjo-news/node_modules/@malept/cross-spawn-promise/src/index.ts:155:16)
at ChildProcess.emit (events.js:310:20)
at ChildProcess.EventEmitter.emit (domain.js:482:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] make: `electron-forge make`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] make script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /.../.npm/_logs/2020-05-28T21_00_29_397Z-debug.log
This is the error:
Issues while validating snapcraft.yaml: The 'apps/yurjo-news' property does not match the required schema: Additional properties are not allowed ('base' was unexpected)
You don't need to specify base, electron-installer-snap should automatically choose it for you.
Please don't close this until we have a working solution. I got this error and it's stuck trying to build the snap.
xxx@xxx:~/.../Electron/yurjo-news$ export DEBUG=electron-installer-snap:snapcraft
xxx@xxx:~/.../Electron/yurjo-news$ npm run make
> [email protected] make /.../Electron/yurjo-news
> electron-forge make
β Checking your system
β Resolving Forge Config
We need to package your application before we can make it
β Preparing to Package Application for arch: x64
β Preparing native dependencies
β Packaging Application
Making for the following targets: deb, snap, zip
β Making for target: deb - On platform: linux - For arch: x64
β Making for target: snap - On platform: linux - For arch: x64The browser-sandbox feature will trigger a manual review in the Snap store.
electron-installer-snap:snapcraft Running '/usr/bin/snapcraft snap --target-arch=amd64 --output=/.../Electron/yurjo-news/out/make/snap/x64/yurjo-news_1.0.0_amd64.snap' in /tmp/electron-snap-39075W2YPFLvtVzl5 +0ms
Setting target machine to 'amd64'
β Making for target: snap - On platform: linux - For arch: x64Launching a VM.
β ¦ Making for target: snap - On platform: linux - For arch: x64Skipping pull yurjo-news (already ran)
Skipping build yurjo-news (already ran)
β Ή Making for target: snap - On platform: linux - For arch: x64Skipping stage yurjo-news (already ran)
β ¦ Making for target: snap - On platform: linux - For arch: x64Skipping prime yurjo-news (already ran)
β Making for target: snap - On platform: linux - For arch: x64The requested action has already been taken. Consider
specifying parts, or clean the steps you want to run again.
β Ή Making for target: snap - On platform: linux - For arch: x64
Failed to create snap '/.../Electron/yurjo-news/out/make/snap/x64/yurjo-news_1.0.0_amd64.snap', mksquashfs failed:
Could not create destination file: No such file or directory
We would appreciate it if you anonymously reported this issue.
No other data than the traceback and the version of snapcraft in use will be sent.
β Έ Making for target: snap - On platform: linux - For arch: x64
Please don't close this until we have a working solution.
Open issues in the issue tracker are for bugs and feature requests. This issue is effectively a support ticket.
Consider building the snap in an Ubuntu 18.04 VM or container _(for example, the Docker container malept/electron-forge-container:node-10)_. Snapcraft seems to be launching its own VM and strange things are happening, which are outside the scope of Electron Forge.
Please don't close this until we have a working solution.
Open issues in the issue tracker are for bugs and feature requests. This issue is effectively a support ticket.
Consider building the snap in an Ubuntu 18.04 VM or container _(for example, the Docker container
malept/electron-forge-container:node-10)_. Snapcraft seems to be launching its own VM and strange things are happening, which are outside the scope of Electron Forge.
So are you basically saying that Electron Forge can't be used right now to develop Snap apps on Ubuntu 20.04 LTS? This should be stated on your website. Especially when all I did was follow your guide from scratch.
I haven't tested this, but it probably works if you run Snapcraft 4.0 and you set base to core20.
Will give it a try.On May 29, 2020 10:17 AM, Mark Lee notifications@github.com wrote:
I haven't tested this, but it probably works if you run Snapcraft 4.0 and you set base to core20.
βYou are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
I haven't tested this, but it probably works if you run Snapcraft 4.0 and you set
basetocore20.
Tested with base core20 and it isn't still working
I'm also unable to build snaps on either 18.04 or 20.04. Should this issue be re-opened?
20.04
$ npm run make
> [email protected] make
> electron-forge make
β Checking your system
β Resolving Forge Config
We need to package your application before we can make it
β Preparing to Package Application for arch: x64
β Preparing native dependencies
β Packaging Application
Making for the following targets: snap
β Making for target: snap - On platform: linux - For arch: x64The browser-sandbox feature will trigger a manual review in the Snap store.
β Making for target: snap - On platform: linux - For arch: x64Ignoring '--target-arch' flag. This flag requires --destructive-mode and is unsupported with Multipass and LXD build providers.
β Making for target: snap - On platform: linux - For arch: x64Build environment project directory changed from '/home/andy/Devel/electron-tests/myapp/out/make/snapcraft', cleaning first.
/snap/multipass/4861/bin/launch-multipass: 3: export: /usr/sbin: bad variable name
β Making for target: snap - On platform: linux - For arch: x64/snap/multipass/4861/bin/launch-multipass: 3: export: /usr/sbin: bad variable name
β Making for target: snap - On platform: linux - For arch: x64An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.
β Making for target: snap - On platform: linux - For arch: x64
An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Command failed with a non-zero return code (2):
/snap/bin/snapcraft snap --target-arch=amd64 --output=/home/andy/Devel/electron-tests/myapp/out/make/snap/x64/myapp_1.0.0_amd64.snap
Error: Command failed with a non-zero return code (2):
/snap/bin/snapcraft snap --target-arch=amd64 --output=/home/andy/Devel/electron-tests/myapp/out/make/snap/x64/myapp_1.0.0_amd64.snap
at ChildProcess.<anonymous> (/home/andy/Devel/electron-tests/myapp/node_modules/@malept/cross-spawn-promise/src/index.ts:172:16)
at ChildProcess.emit (events.js:314:20)
at ChildProcess.EventEmitter.emit (domain.js:483:12)
at maybeClose (internal/child_process.js:1022:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
18.04
> [email protected] make
> electron-forge make
β Checking your system
β Resolving Forge Config
We need to package your application before we can make it
β Preparing to Package Application for arch: x64
β Preparing native dependencies
β Packaging Application
Making for the following targets: snap
β Making for target: snap - On platform: linux - For arch: x64The browser-sandbox feature will trigger a manual review in the Snap store.
β § Making for target: snap - On platform: linux - For arch: x64Ignoring '--target-arch' flag. This flag requires --destructive-mode and is unsupported with Multipass and LXD build providers.
Build environment is in unknown state, cleaning first.
β Making for target: snap - On platform: linux - For arch: x64/snap/multipass/4861/bin/launch-multipass: 3: export: /usr/sbin: bad variable name
/snap/multipass/4861/bin/launch-multipass: 3: export: /usr/sbin: bad variable name
β Making for target: snap - On platform: linux - For arch: x64An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.
β Making for target: snap - On platform: linux - For arch: x64
An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Command failed with a non-zero return code (2):
/snap/bin/snapcraft snap --target-arch=amd64 --output=/home/andy/Devel/electron-tests/myapp/out/make/snap/x64/myapp_1.0.0_amd64.snap
Error: Command failed with a non-zero return code (2):
/snap/bin/snapcraft snap --target-arch=amd64 --output=/home/andy/Devel/electron-tests/myapp/out/make/snap/x64/myapp_1.0.0_amd64.snap
at ChildProcess.<anonymous> (/home/andy/Devel/electron-tests/myapp/node_modules/@malept/cross-spawn-promise/src/index.ts:172:16)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:483:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
On 18.04 I can build snaps for another project OK, so multipass is configured OK.
My package.json forge maker config is
{
"name": "@electron-forge/maker-snap",
"config": {
"icon": "bacteria.png",
"summary": "Pretty Awesome"
}
}
I'm suspicious of the error in both cases (both OS's above) of
x64/snap/multipass/4861/bin/launch-multipass: 3: export: /usr/sbin: bad variable name
/snap/multipass/4861/bin/launch-multipass: 3: export: /usr/sbin: bad variable name
Invoking with DEBUG=electron-installer-snap:snapcraft npm run make shows no significant extra info.
My system info
E.g. on my Ubuntu 20.04 VM running in Vmware with VT-x configured in Vmware processor settings.
$ snapcraft --version
snapcraft, version 4.8.2
andy@ubuntu:~/Devel/electron-tests/myapp$ which snapcraft
/snap/bin/snapcraft
andy@ubuntu:~/Devel/electron-tests/myapp$ multipass --version
multipass 1.6.2
multipassd 1.6.2
andy@ubuntu:~/Devel/electron-tests/myapp$ multipass list
Name State IPv4 Image
primary Running 10.240.47.137 Ubuntu 20.04 LTS
snapcraft-myapp Delayed Shutdown 10.240.47.86 Ubuntu Snapcraft builder for Core 18
andy@ubuntu:~/Devel/electron-tests/myapp$ uname -v
#62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021
# And on my 18.04 system...
$ uname -v
#83~18.04.1-Ubuntu SMP Tue May 11 16:01:00 UTC 2021
Possibly also related is https://github.com/electron-userland/electron-installer-snap/issues/83