130

I have nvm setup to use the latest long term support version in ~/.nvm/alias/default, by setting it to lts/*.

When I try and have my shell initialize my nvm version (zsh), I get the following error:

N/A: version "N/A -> N/A" is not yet installed.

Why is this happening?

Brad Parks
  • 66,836
  • 64
  • 257
  • 336

6 Answers6

286

Error: N/A: version "N/A -> N/A" is not yet installed

I got this error after doing nvm use (switching to older Node version 8.11.1, shown in .nvmrc file), nvm uninstall (newer Node version 9.0.0), then a git push.

nvm ls shows my "default" Node version was pointing to the uninstalled one: default -> 9.0.0 (-> N/A). This caused the error.

To fix: nvm alias default node points "default" to the latest installed Node version (8.11.1).

Now nvm ls shows default -> node (-> v8.11.1).

Raymond Gan
  • 4,612
  • 3
  • 24
  • 19
  • 4
    Sometimes you will have to ran `nvm install lts/*` previously to `nvm alias default node` – CrsCaballero Nov 19 '19 at 20:48
  • 1
    The key part of the command is `nvm alias default` - as long as the version with the keyword after default is installed, you're good to go. Incidentally, I think `stable` is a better "default" than `node`. – Benjamin R Jan 04 '20 at 11:38
33

Turns out this error is telling me that I don't have it installed (ie the latest long term support version). To fix it, I had to run:

$ nvm install 'lts/*'

and it worked after that! Snagged from here

Jacob Ford
  • 4,553
  • 5
  • 27
  • 42
Brad Parks
  • 66,836
  • 64
  • 257
  • 336
24

Your "default" Node version is not reachable (many reasons)

Many answers but there isn't a straightforward solution, let's try with:

nvm install 'lts/*'
nvm alias default node  

the first command ensure you have latest LTS version installed and then set the default.

freedev
  • 25,946
  • 8
  • 108
  • 125
11

I faced the same issue when i used nvm to install node 12 and node 10. To fix this i used the command: nvm alias default node

Hamfri
  • 1,979
  • 24
  • 28
9

Prevent nvm from trying to use when first loading

You may not need (or want) the latest version of node installed, and yet wish to have the nvm command available, so in your .bashrc (or equivalent) include the --no-use flag when loading nvm

[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --no-use  # This loads nvm

Thanks to Ioannis Poulakas

Jeff
  • 2,095
  • 25
  • 18
  • This is a particularly useful answer since this is exactly what NVM's own documentation provides for the `.bashrc`, except it's missing the "--no-use" – DevBodin Apr 06 '22 at 16:03
-4

I fixed it by running nvm use v12.21.0