PM2 startup on macOS Catalina I'm trying to set pm2 to auto start on Mac OS like this pm2 startup

However I keep getting this error: 
env: Fusion.app/Contents/Public:/usr/local/bin: No such file or directory

I tried the suggestion from this page: https://stackoverflow.com/questions/26664282/how-to-use-pm2-startup-command-on-mac But the even using this command I keep getting the same error: pm2 startup darwin

How can I get pm2 to startup automatically on Mac OS Catalina?

Thanks!
What's probably happening is that pm2 isn't generating the correct script because your PATH variable contains spaces (most likely &quot;VMWare Fusion&quot; in your case).
Run echo $PATH, clean it up by escaping the space character using a backslash (\), then manually paste the resulting PATH variable in pm2's generated startup script.
So basically instead of running a generated pm2 script like this:
sudo env PATH=$PATH:/usr/local/bin /usr/local/lib/node_modules/pm2/bin/pm2 startup launchd -u &lt;user&gt; --hp &lt;user_folder&gt;

run something like this:
sudo env PATH=&lt;your `echo $PATH` output with escaped spaces&gt;:/usr/local/bin /usr/local/lib/node_modules/pm2/bin/pm2 startup launchd -u &lt;user&gt; --hp &lt;user_folder&gt;