6

I have packaged a Node.js script into an executable using pkg. With the macOS catalina release, all software should be notarized by Apple. As Apple only allows .dmg, .pkg or .app files for distribution. I used pkgbuild to create an OS X installer and tried following:

  • Notarizing .pkg: It failed with an error: The binary is not signed. though it's code-signed.
  • Code-Signing binary first: I tried to code-sign the binary(i.e. created using pkg) first before notarization. It also failed with an error main executable failed strict validation.

I found similar issue on GitHub for pkg. I tried multiple npm modules including nexe, encloseJS with no luck.

Is there any alternative for this or shall I bundle the native Node.js binary along with my script to a pkg installer so that it'll be notarized easily?

  • Hi, I am facing the same problem. did you find a solution to this? – Trident Dec 02 '19 at 17:21
  • 2
    Not yet. The `npm` modules seem to have some bug due to which notarization is failing. One workaround is to use the native Node.js binary to run the script by putting the shebang line at the top and making the file executable. This won't cause any Notarization warning as the text files need not be notarized. – Vinit Shahdeo Jan 03 '20 at 12:31
  • Is there any workaround? Is nexe working? – Nimit Aggarwal Aug 14 '20 at 12:19
  • I got this to work using https://github.com/pmq20/node-packer – Jeroen Vannevel Nov 14 '20 at 14:25

0 Answers0