Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

node.js

nvm

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?

like image 241
Brad Parks Avatar asked Mar 23 '18 12:03

Brad Parks


People also ask

How do I get the latest version of NVM?

Make a new file like install-nvm.sh e.g. with vim or vi or whatever. Then copy paste the above script (type i to insert, type :wq to save it), then do sh install-nvm.sh ; This solution was based on. Github nvm repo.

Can we install NVM using npm?

Node Version Manager, more commonly called nvm, is the most popular way to install multiple versions of Node. js, but is only available for Mac/Linux and not supported on Windows. Instead, we recommend installing nvm-windows and then using it to install Node. js and Node Package Manager (npm).


2 Answers

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).

like image 172
Raymond Gan Avatar answered Sep 17 '22 23:09

Raymond Gan


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

like image 35
Brad Parks Avatar answered Sep 18 '22 23:09

Brad Parks