Nvm: System Overrides Default?

Created on 9 Jun 2017  ·  7Comments  ·  Source: nvm-sh/nvm

  • Operating system and version:
    MacOS 10.12

  • nvm debug output:


nvm --version: v0.33.2
$SHELL: /bin/bash
$HOME: /Users/steve
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)'
uname -a: 'Darwin 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64'
OS version: Mac 10.12.5 16F73
curl: /usr/bin/curl, curl 7.51.0 (x86_64-apple-darwin16.0) libcurl/7.51.0 SecureTransport zlib/1.2.8
wget: /usr/local/bin/wget, GNU Wget 1.18 built on darwin15.5.0.
git: /usr/bin/git, git version 2.11.0 (Apple Git-81)
nvm current: system
which node: /usr/local/bin/node
which iojs:
which npm: /usr/local/bin/npm
npm config get prefix: /usr/local
npm root -g: /usr/local/lib/node_modules

  • nvm ls output:

       v0.10.38
        v0.12.0
         v4.0.0
         v4.1.0
         v4.1.1
         v4.2.0
         v4.2.2
         v4.4.5
         v5.6.0
         v6.5.0
         v8.1.0
->       system
default -> node (-> v8.1.0)
node -> stable (-> v8.1.0) (default)
stable -> 8.1 (-> v8.1.0) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> N/A)
lts/argon -> v4.8.3 (-> N/A)
lts/boron -> v6.11.0 (-> N/A)

  • How did you install nvm? (e.g. install script in readme, homebrew):
    Install script

  • What steps did you perform?
    I have tried resetting the default, reinstalling nvm, and changing the version I'm trying to default to.

  • What happened?
    Currently, in new shells, it reverts to the system Node.

  • What did you expect to happen?
    I expected the default node to be used instead of the system.

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?


export PATH="$PATH:$HOME/.composer/vendor/bin" #Adds globally installed composer scripts
export PATH=/usr/local/php5-7.0.10-20160831-102733/bin:$PATH

needs followup

Most helpful comment

@ljharb, I'll double check Monday. I've been away for work so I only just got to check back in. Thanks.

All 7 comments

Maybe I'm just missing something but I can't spot it.

My hunch is that you have something in one of your profile files that's setting the PATH, after nvm.sh is sourced.

Can you confirm whether or not the nvm lines are the last ones in the profile file they appear in? What does echo "$PATH" say?

That was it for me, the PATH. I had nvm sourced as the very first thing, before other path settings, so /usr/local/bin was masking it.

@firrae can you confirm that https://github.com/creationix/nvm/issues/1548#issuecomment-307298901 is the case?

@ljharb, I'll double check Monday. I've been away for work so I only just got to check back in. Thanks.

09:33 $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/.composer/vendor/bin:/usr/local/sbin

Maybe that is the issue then? nvm isn't even listed in that but the command works.

OK, so I guess this weekend IT decided to "update" my laptop and messed up a bunch of stuff, but nvm now works with the default.

09:41 $ echo $PATH
/Users/steven.lambe/.nvm/versions/node/v8.1.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/.composer/vendor/bin:/usr/local/sbin

I shall need to have a talk with IT, but this is now corrected. Thanks.

P.S. @neverfox the order they are in for me is having no issue but I have my system Node installed via Brew.

Was this page helpful?
0 / 5 - 0 ratings