Can't run node app on ssh workspace. "bash: line 1: node: command not found"



I have a remote workspace on my digital ocean account. I have ubuntu 14 lts with node 6.9.2 installed using nvm. I can call “node myapp.js” from the command line and it works fine. But if I use the “run” button, I get this error:

bash: line 1: node: command not found

Any ideas on how to solve this?


this can happen if nvm is not loaded when running env -i bash -li try to add the code for loading nvm from ~/.bashrc to ~/.profile too