is it possibile to create a Flatpak for runnig a simple Nodejs application? I mean just an Express API server listening on port 3000. I cannot find any documentation about it.
it’s defiantly possible. I would probably start with the electron instructions and simplify them for your usecase. Especially, if you have never done it before.
Or look at Flathub · GitHub for an app, that’s similar to yours.
I tried to follow the instructions for build the sample application with an Ubuntu 20.04 machine, but it gave me this error:
(flatpak-builder:24646): flatpak-builder-WARNING **: 14:58:58.045: Unknown source type inline (flatpak-builder:24646): Json-WARNING **: 14:58:58.047: Failed to deserialize "sources" property of type "gpointer" for an object of type "BuilderModule" Downloading sources Initializing build dir Committing stage init to cache Starting build of org.flathub.electron-sample-app ======================================================================== Building module electron-sample-app in /home/paolo/repos/electron-sample-app/flatpak/.flatpak-builder/build/electron-sample-app-1 ======================================================================== Running: npm install --offline bwrap: Can't chdir to /run/build/electron-sample-app/main: No such file or directory Error: module electron-sample-app: Child process exited with code 1
I tried also with others examples found here:
but they fail with errors.
You don’t seem to have a file named
main or are not copying it
Ok, but I simply follow the guide, I suppose this should work, I don’t know where is this main file
I guess the build version of https://github.com/flathub/electron-sample-app/blob/master/main.js but I will only have time to look into this after the weekend