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?