On GCP:
Download NVM using following command on terminal curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
Verify nvm is installed using nvm --version
Install the required node version using nvm install 20.11.0 and then use the installed version using nvm use 20.11.0
Then node bot.js
On GCP:
npm install -g pm2
pm2 start bot.js --name "discord-bot"
pm2 status
pm2 logs discord-bot
CTRL + c to exit log view
pm2 save
pm2 startup
then follow instructions given
To update:
pm2 stop discord-bot
pm2 status
Then follow start up instructions above