In a continuous deployment context I have a shell script executed to update and restart my app in the remote server
the script is:
ssh user@myserver <<'ENDSSH'
cd /opt/myapp
git pull
npm i
forever stop src
npm run staging
ENDSSH
the output is:
stdin: is not a tty
Already up-to-date.
-bash: line 3: npm: command not found
-bash: line 4: forever: command not found
-bash: line 5: npm: command not found
Note:
everything work if I ssh onto the remote server and enter those commands manually
node and npm are installed with nvm on the remote server
which npm
give/root/.nvm/versions/node/v6.10.0/bin/npm