zsh-nvm: NVM does not load the default alias

Hello again,

I noticed that even though I have the “lag” at the shell start, the correct version of node is not loaded:

martin@yeti ~                                                                                              [15:06:34] 
> $ node --version                                                                                           ⬡ 6.9.5 
v6.9.5
martin@yeti ~                                                                                              [15:06:37] 
> $ nvm alias                                                                                                ⬡ 6.9.5 
default -> v7.5.0
node -> stable (-> v7.5.0) (default)
stable -> 7.5 (-> v7.5.0) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> N/A)
lts/argon -> v4.7.3 (-> N/A)
lts/boron -> v6.9.5 (-> N/A)

And the NVM_NO_USE is not set.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Hi,

I know this is closed, but I had this exact problem and found a solution that worked for me. I placed plugins+=(zsh-nvm) at the end of my .zhrc file. Now it always loads my default version.

@lambrechts Thanks for posting your solution here. Hopefully it’ll help somebody else who arrives here with the same problem.

Relevant XKCD: https://xkcd.com/979/

Hello @lukechilds

So, I’m using other variable settings, but I disabled them to test and still don’t have the correct version loaded, so it does not seem related to it.

I tried the manual loading and I end up with this message:

nvm is not compatible with the npm config "prefix" option: currently set to "/home/martin/.nvm/versions/node/v7.5.0"
Run `npm config delete prefix` or `nvm use --delete-prefix v7.5.0 --silent` to unset it.

I don’t have any idea of what this option is…