Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is possible to make "deb" and "rpm" on Mac OSX? #436

Closed
3 tasks done
douglasjunior opened this issue Feb 20, 2018 · 6 comments
Closed
3 tasks done

Is possible to make "deb" and "rpm" on Mac OSX? #436

douglasjunior opened this issue Feb 20, 2018 · 6 comments
Labels
blocked/upstream Issues blocked by upstream bugs question

Comments

@douglasjunior
Copy link

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

I'm trying to use electron-forge make to distribute my application with Mac OSX High Sierra 10.13.3 (17D102).

I'm be able to make for "darwin" and "win32", but I cant do it for "deb" and "rpm".

For "darwin", I just run electron-forge make --platform=darwin.

For "win32", I installed wine and mono-mdk with homebrew, and then electron-forge make --platform=win32 --arch=ia32,x64.

For "linux", I installed dpkg and rpm with homebrew, and then electron-forge make --platform=linux --arch=ia32,x64. But I receive this error:

$ electron-forge make --platform=linux --arch=ia32,x64
✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing to Package Application for arch: ia32,x64
✔ Preparing to Package Application for arch: ia32,x64
✔ Compiling Application
✔ Compiling Application
✔ Preparing native dependencies
✔ Preparing native dependencies
✔ Packaging Application
Making for the following targets:
✖ Making for target: deb - On platform: linux - For arch: ia32

An unhandled error has occurred inside Forge:
An error occured while making for target: deb
Cannot read property 'toString' of undefined
TypeError: Cannot read property 'toString' of undefined
    at spawn.then.catch.err (/Users/douglas/projetos/Electron/learning-electron/node_modules/electron-installer-debian/src/spawn.js:30:113)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

My package.json is like that:

{
  "name": "learning-electron",
  "productName": "learning-electron",
  "version": "1.0.0",
  "description": "My Electron application description",
  "main": "src/index.js",
  "scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "run-s make:mac make:linux make:windows",
    "make:mac": "electron-forge make --platform=darwin",
    "make:linux": "electron-forge make --platform=linux --arch=ia32,x64",
    "make:windows": "electron-forge make --platform=win32 --arch=ia32,x64",
    "publish": "electron-forge publish",
    "lint": "eslint --cache --color --ext .jsx,.js src"
  },
  "keywords": [],
  "author": "dougl",
  "license": "MIT",
  "config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "dmg"
        ],
        "linux": [
          "deb",
          "rpm",
          "zip"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "yarn"
      },
      "electronWinstallerConfig": {
        "name": "learning_electron"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "learningelectron"
      }
    }
  },
  "dependencies": {
    "electron-compile": "6.4.2",
    "electron-devtools-installer": "2.2.3",
    "electron-squirrel-startup": "1.0.0",
    "react": "16.2.0",
    "react-dom": "16.2.0",
    "react-hot-loader": "3.1.3"
  },
  "devDependencies": {
    "babel-eslint": "8.2.2",
    "babel-plugin-transform-class-properties": "6.24.1",
    "babel-preset-es2015": "6.24.1",
    "babel-preset-react": "6.24.1",
    "electron-forge": "5.1.1",
    "electron-installer-debian": "0.8.0",
    "electron-installer-redhat": "0.5.0",
    "electron-prebuilt-compile": "1.8.2",
    "electron-wix-msi": "1.3.0",
    "eslint": "4.18.0",
    "eslint-config-airbnb": "16.1.0",
    "eslint-plugin-import": "2.8.0",
    "eslint-plugin-jsx-a11y": "6.0.3",
    "eslint-plugin-react": "7.7.0",
    "npm-run-all": "4.1.2"
  }
}

Here is the project that I am using for testing: https://github.com/douglasjunior/learning-electron

node v8.9.4
npm v5.6.0
@malept
Copy link
Member

malept commented Feb 20, 2018

To answer the question in your issue title: yes, it's possible to make .deb and .rpm packages on macOS. You're probably missing fakeroot (per the docs in both Electron Forge and electron-installer-debian.

That being said, there's a bug in electron-installer-debian where it doesn't tell you what's wrong, so I've filed an issue there: electron-userland/electron-installer-debian#129

Additionally, you don't need to add electron-installer-debian and electron-installer-redhat to your devDependencies, as it should be pulled in by Electron Forge.

@malept malept closed this as completed Feb 20, 2018
@douglasjunior
Copy link
Author

Works, thanks!

@malept
Copy link
Member

malept commented Feb 21, 2018

That being said, there's a bug in electron-installer-debian where it doesn't tell you what's wrong, so I've filed an issue there: electron-userland/electron-installer-debian#129

The bug has been fixed in electron-installer-debian 0.8.1, if you update the dependencies of Electron Forge, you should get the new version.

@douglasjunior
Copy link
Author

No problem, thank you for the great job in this tool.

@JensDebergh
Copy link

Hey there!

I'm having similar issues on 6.0.0-beta.43.

I tried running the make command on my macbook during lunch break and keep getting following error:

Screenshot 2019-08-02 at 13 55 30

I have both fakeroot and dpkg installed on machine.

I did notice that @electron-forge/make-deb has follow snippet of code on 6.0.0 ensuring it will never run on any other platform then linux.

https://github.com/electron-userland/electron-forge/blob/master/packages/maker/deb/src/MakerDeb.ts#L22

Is support dropped? Or did this just slip in?

@malept
Copy link
Member

malept commented Aug 13, 2019

This has been fixed in 6.0.0 beta 44.

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
Co-authored-by: Electron Bot <electron-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/upstream Issues blocked by upstream bugs question
Projects
None yet
Development

No branches or pull requests

3 participants