PM2 shows old version when re-building app
To serve the latest code in the directory, run:
$ pm2 reload APP_NAME
You can find out APP_NAME by
$ pm2 list
When you fetch the latest code and want to run it, restart the server with
$ pm2 reload APP_NAME
To Start a server for the first time with a specific name
$ pm2 start path/to/index.js --name "api"
Note: On linux you might have to run pm2 with sudo