npmdebelectron-forge

Electron Forge issue: "cannot make for linux and target deb"


I'm once again facing an issue and I can't get out of it...

The problem

I have an Electron app and I want to build it for linux. So far, I've succeed to create a Windows (Squirrel) build for it, but when I execute the same command from a virtual machine, it gives this error: cannot make for linux and target deb: the maker declared that it cannot run on linux

Forge configuration

module.exports = {
  packagerConfig: {
    asar: true,
    linux: {
      target: 'deb',
    }
  },
  rebuildConfig: {},
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      config: {
        authors: 'Sample author',
        description: 'Some description'
      },
    },
    {
      name: '@electron-forge/maker-zip',
      platforms: ['darwin'],
    },
    {
      name: '@electron-forge/maker-deb',
      config: {
        authors: 'Sample author',
        description: 'Some description',
        "name": "app",
        "category": "Games"
      },
    },
    {
      name: '@electron-forge/maker-rpm',
      config: {},
    },
  ],
  plugins: [
    {
      name: '@electron-forge/plugin-auto-unpack-natives',
      config: {},
    },
  ],
};

I was expecting to receive a nice .deb file, but I got that error...


Solution

  • I resolved!

    Solution

    authors and description setting has to be under quotes, like so:

    "authors":"test",
    "description":"some desc"
    

    Full configuration

    module.exports = {
    packagerConfig: {
        asar: true,
        linux: {
          target: 'deb',
        }
      },
      rebuildConfig: {},
      makers: [
        {
          name: '@electron-forge/maker-squirrel',
          config: {
            authors: 'Sample author',
            description: 'Some description'
          },
        },
        {
          name: '@electron-forge/maker-zip',
          platforms: ['darwin'],
        },
        {
          name: '@electron-forge/maker-deb',
          config: {
            "authors": 'Sample author',
            "description": 'Some description',
            "name": "app",
            "category": "Games"
          },
        },
        {
          name: '@electron-forge/maker-rpm',
          config: {},
        },
      ],
      plugins: [
        {
          name: '@electron-forge/plugin-auto-unpack-natives',
          config: {},
        },
      ],
    };