Question

I am trying to have multiple connections to my dev server by ssh-ing once into my server and the using screen to open multiple sessions. My problem is that when I run nvm command in screen, the command can not be found. When I exit screen and run the command in the pure ssh terminal it runs fine. I think this is a PATH problem. I wanted to get an absolute path for nvm to see if I can run that in screen.

I ran the code below to find the path

 ~$ nvm
 //SHOWS USAGE INFO

 ~$ whereis nvm
 nvm:

 ~$ screen
 //LOADS INTO SCREEN SESSION

 ~$ nvm
 bash: nvm: command not found

What does this mean for the install of nvm. If I change its install directory could I then run it in screen. If this is the case then why wouldn't screen run nvm in the first place.

Was it helpful?

Solution

Try manually activating nvm with:

source ~/.nvm/nvm.sh

OTHER TIPS

Try

which nvm

instead of whereis. This will give you the full path.

On startup of a terminal I need to run .nvm.sh before I can execute nvm. I put .nvm.sh into my .bashrc. Turns out that an ssh connection runs the .bashrc but a screen connection does not. This is why the command was not available in screen. I had to manually run .nvm.sh.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top