'Cant build electron app without code signing

I've tried electron-builder and electron-packager, and I get this Error

Error: Command failed: codesign --verify --deep --strict --verbose=2

I don't need it to be code signed or the app store, I just need it to run on my computer.

build

"build":  "electron-packager ./public --app-version 1.4.3 --platform darwin --icon ./public/icon.icns --out ./dist --overwrite"

I've tried electron packager and electron builder.



Solution 1:[1]

I'm not seeing the problem in what you posted. These are the cmds I use for electron-packager - "package-mac", "package-win". Maybe they will help.

Electron-builder use "pack" and "dist" and I have not included the associated scripts for those.

"scripts": {
    "start": "APP_DEV=true electron .",
    "package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --asar --ignore=/dist --ignore=/build --prune=true --out=release-builds",
    "package-win": "electron-packager . --overwrite --platform=win32 --arch=ia32 --asar --ignore=/dist --ignore=/build --prune=true --out=release-builds",
    "postinstall": "install-app-deps",
    "pack": "build --dir",
    "dist": "build -mw"
  },

Solution 2:[2]

You should follow this guide of Code Signing if you are developing mac application.

But if you want to Disable Code Signing During the Build Process on macOS

Run this command in your terminal:

export CSC_IDENTITY_AUTO_DISCOVERY=false

Hope this will solve your problem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Celestin NIYONSABA