6

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.

4

3 回答 3

9

尝试使用以下命令手动激活 nvm:

source ~/.nvm/nvm.sh
于 2014-01-14T15:05:46.357 回答
0

在启动终端时,我需要先运行 .nvm.sh,然后才能执行 nvm。我将 .nvm.sh 放入我的 .bashrc。原来 ssh 连接运行 .bashrc 但屏幕连接不运行。这就是该命令在屏幕中不可用的原因。我不得不手动运行.nvm.sh。

于 2013-10-07T22:02:34.193 回答
0

尝试

which nvm

而不是在哪里。这将为您提供完整的路径。

于 2013-10-07T21:52:43.233 回答