Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'nvm' is not recognized as an internal or external command Windows

Installed NVM (Node version manager ) for windows from here. Actually NVM was getting installed in Administrator account. Thought to install it in C:\Node\ directory so it would be found in CMDfor user and set environment variable as mentioned here

But nothing is working for me.

enter image description here enter image description here

OS: Windows 10 Enterprise

like image 295
Dipak Telangre Avatar asked May 13 '19 12:05

Dipak Telangre


People also ask

Is not recognized as an internal or external command NVM?

Steps to install NVM In the screenshot, it shows NVM is not recognized as an internal or external command. In the resulting folder, go to the assets section and click on the nvm-setup. zip file. Download the file and unzip it and right click on the installation file and select 'Run as Administrator'.

Does NVM work on Windows?

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.

How install NVM-setup.exe as administrator?

Open a CMD prompt (run as administrator), and install the downloaded version of nvm, nvm-setup.exe, from within this CMD command prompt. From within the admin level command prompt, run "nvm install 7.2. 1", or whatever node version you want to install.


2 Answers

So there are multiple answers here, and between them all, the information required to get NVM working is present, however; it's very frustrating, that people only include single steps in an answer, and are not explicit about it only being a single step, therefore, I have taken much time to rewrite the correct way to solve this issue (or answer this question).




ADMINISTRATOR PRIVILEGES ARE REQUIRED!


I did what the other answers had suggested, but it didn't work, and here's why...


The other answers tell you that you need to add the Env Variables...

  •     NVM_SYMLINK
  •     NVM_HOME

...to your Windows PATH, which is what the other answers have submitted that you do.


Here is what the other answers fail to mention:

You add the PATH Variables using commands with Administrator privileges, which means opening the console with administrative privileges.

It's not difficult:

  1. Use the keybinding...

    • WIN + R
  2. The Windows Run box should open, once you see it, type the text next to the bullet below into the text-input box.

    • cmd.exe

  3. After you type cmd.exe into the text-input, do not default to clicking the ENTER button, or pressing the ENTER key. Rather than the using the sole ENTER key, you are going to instead use the key-binding below.

    • CTRL + SHIFT + ENTER

Once inside, use the following commands.


    C:\...\...>  NVM_HOME = C:\ProgramData\nvm
    C:\...\...>  NVM_SYMLINK = C:\Program Files\nodejs


At this point, NVM should work. You can test it by using the command:
    C:\...\...>  node --version

  // OUTPUT: v16.13.0  ("should print somthing like this")

-OR- more simply, just...

    C:\...\...>  node -v

  // OUTPUT: v16.13.0  ("should print somthing like this")
like image 60
j D3V Avatar answered Sep 17 '22 13:09

j D3V


NVM_HOME & NVM_SYMLINK must be in System variables

NVM_HOME = C:\ProgramData\nvm
NVM_SYMLINK = C:\Program Files\nodejs

%NVM_HOME% , %NVM_SYMLINK% in the PATH variable under System variables .

For Powershell or command prompt

  • Close all ps terminal or cmd
  • Re-open in administrator mode
  • Run nvm --version , you should see the version .
  • for cmd , you can check the path using echo %NVM_HOME% , that should return the same value as in system variable
like image 45
passionatedevops Avatar answered Sep 18 '22 13:09

passionatedevops