0

I installed the following on Ubuntu 14.04.1 LTS as the Ubuntu user:

  • nvm and node
  • strongloop
  • git
  • postgres

Everything worked fine after the installs. I was able to use which and all paths resolved. For instance I got this:

ubuntu@ip-10-0-0-110:~$ which node
/home/ubuntu/.nvm/versions/node/v0.12.0/bin/node

ubuntu@ip-10-0-0-110:~$ which npm
/home/ubuntu/.nvm/versions/node/v0.12.0/bin/npm

ubuntu@ip-10-0-0-110:~$ npm config list
; cli configs
user-agent = "npm/2.5.1 node/v0.12.0 linux x64"

; node bin location = /home/ubuntu/.nvm/versions/node/v0.12.0/bin/node
; cwd = /home/ubuntu
; HOME = /home/ubuntu

Today I SSHed into the server and paths are not resolving (with the exception of nvm) by which I mean none of the above works. Server has not been restarted.

When I look at .bashrc the only export I see is for nvm but I would have expected other exports since it was working before.

Not sure if this helps, but when it was working the first time, I logged in with a second terminal session (so that I had 2 ssh sessions running at the same time). The 2nd session would not work resolve paths, thought that first session was resolving fine.

$ echo $PATH`    
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Any idea why it was working fine for that first session but not anymore?

masegaloeh
  • 18,236
  • 10
  • 57
  • 106
Lee Johnson
  • 103
  • 4

1 Answers1

1

It sounds like something is missing with nvm.

  1. ssh into the box
  2. make sure that the nvm vars are set . ~/.nvm/nvm.sh
  3. tell nvm which node version to use nvm use 0.12.0
  4. set that as your default version nvm alias default 0.12.0
Michael
  • 26
  • 2
  • As someone who's new to nvm it didn't occur to me that all the npm packages that I installed with one Node version wasn't installed with other node versions in nvm. So I had 2 versions of Node installed in nvm and I mistakenly was using the wrong version that did not have the npm packages installed. – Lee Johnson Feb 12 '15 at 20:20