Launch Daemon for NodeJS App Won't start on reboot

Solution 1:

Presuming your application can be run within the Terminal, making an AppleScript program (using Script Editor) containing the commands that you would run in the terminal and then exporting that program as a Run-Only Application, placing it in your /Applications/ directory can create your program launcher.

There is a helpful answer on using do shell script in AppleScript here.

AppleScript Example: Running hdiutil to mount a sparseimage bundle as a Time Machine backup drive

do shell script "hdiutil attach /Volumes/NewVolumeD/TimeMachine.sparsebundle"

Then, navigating to System Preferences > Users & Groups > (your account) > Login Items, unlocking the settings menu and then using the + button on the bottom left to select your launcher application from Applications. That launcher will now run on login, check mark on Hide so that it doesn't throw unwanted messages.

Alternatively, you could make a zsh or bash script and tell AppleScript execute the shell script (given its absolute path) instead of specifying each command in AppleScript itself.

EDIT: Instead of using Login Items, you can place the Application Bundle in /Library/StartupItems (though it is deprecated) if you want it to launch on startup instead of login.