Closed aedwardg closed 2 years ago
Solved by altering the .bashrc
file on the droplet.
By default the .bashrc
loads nothing for non-interactive shells.
The ssh action used a non-interactive shell, so nvm was never loaded.
Moving the lines that load nvm to above the early exit solved the problem:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
This only occurred after trying to set up the droplet for new deployment of bot running on Discord.js v13.
Symptoms: When deploy action was run, bot would crash with error:
Droplet was using nvm and node version 16.14.0. PM2 was updated.
The GH Action logs, however, indicated that nvm was not installed and pm2 was out of date:
The node:events was also indicative of the node version running being older than v. 16.6 (even though 16.14.0 was the nvm default).