Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NVM command works in terminal but not in screen

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.

like image 967
user1600812 Avatar asked Oct 07 '13 21:10

user1600812


People also ask

How do I switch from Node to NVM?

For switching to different versions that are already installed you can use the following commands for different scenarios: nvm use node #uses latest Node. js version available on server. nvm use --lts #This will switch to the latest LTS version nvm use 14.15.

Do I need Node for NVM?

Before installing NVM, you do not need a Node version installed on your machine, and, if you do have Node installed, it does not matter. Installing NVM and using it to install Node versions will work separately from the existing one.


1 Answers

Try manually activating nvm with:

source ~/.nvm/nvm.sh
like image 133
wintondeshong Avatar answered Nov 03 '22 01:11

wintondeshong