Path "$SNAP" does not exist

I’m trying to snap an electron app.

I used electron-builder to create the original snapcraft.yaml file but changed it so that it builds with multipass.

When running snapcraft it shows me the following error:

2019/05/20 16:16:33.835896 container.go:242: in snap “bottle”: path “$SNAP/bin/desktop-launch” does not exist
2019/05/20 16:16:33.835939 container.go:242: in snap “bottle”: path “$SNAP/bin” does not exist
2019/05/20 16:16:33.835947 container.go:242: in snap “bottle”: path “$SNAP” does not exist

This is the snapcraft.yaml file.

If I’m using --debug I can see desktop-launch in the following folders

./project/dist/__snap-x64/parts/desktop-gtk2/build/gtk/desktop-launch
./project/dist/__snap-x64/parts/desktop-gtk2/install/bin/desktop-launch

And bottle in the following folder

./project/dist/linux-unpacked/bottle

How do I need to refer to desktop-launch and bottle?

Try changing the command line of your app to just:

command: bin/desktop-launch $SNAP/app/bottle

Unfortunately that didn’t work.

It can’t find /bin/desktop-launch.

because you added a slash in front of what james provided :wink:

Unfortunately it doesn’t work either without the slash.

2019/05/28 04:51:08.504888 container.go:242: in snap "bottle": path "bin/desktop-launch" does not exist
2019/05/28 04:51:08.505054 container.go:242: in snap "bottle": path "bin" does not exist

Under which folder must a path exist in order to be available for command?

well, are you sure you built the dsktop launcher properly (if you use the ```base:````keyword in your snapcraft.yaml you need to completely build the part from scratch)

you should find it in the prime directory after your build …

This is an example of what @ogra is talking about. Uses base: core18, so you have to build the deskop-gtk3 part from scratch.