I have a CircleCI config that has a deployment script at the end. The command should SSH into the server, move to a directory and execute an NPM script. It looks like this:
ssh -o StrictHostKeyChecking=no ubuntu@xx.xx.xx.xx "cd /var/www/example.com && npm run restart_qa"
This throws the following error:
bash: npm: command not found
This indicates NPM isn't installed on the server, but it is. To test this, if I run the commands separately, they work. e.g.
ssh -o StrictHostKeyChecking=no ubuntu@xx.xx.xx.xx
cd /var/www/example.com
npm run restart_qa
So what's the problem here?