44

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

Dipak Telangre
  • 1,792
  • 4
  • 19
  • 46

17 Answers17

42

After I did the previous answers with the PATH and NVM_HOME and NVM_SYMLINK it's not worked for me until I run the cmd via administrator.

  • in windows search click "cmd"
  • mouse right click "run as administrator"

Then node -v worked!

RGriffiths
  • 5,722
  • 18
  • 72
  • 120
Israel
  • 1,165
  • 11
  • 11
17

Restart Windows

Not perfect solution but in my case restarting the windows worked.

Ajeet Eppakayala
  • 1,186
  • 1
  • 10
  • 17
9

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
7
  1. https://github.com/coreybutler/nvm-windows/releases
  2. Click on nvm-setup.zip
  3. Extract and install it
  4. Type the below command to verify if your nvm installation was successful. $ nvm --version
Dharman
  • 30,962
  • 25
  • 85
  • 135
Shilpe Saxena
  • 219
  • 2
  • 8
6

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")
JΛYDΞV
  • 8,532
  • 3
  • 51
  • 77
4

NVM_HOME and NVM_SYMLINK should be in same path. Below I have linked that system variables enter image description here

Sujatha Girijala
  • 1,141
  • 8
  • 20
2

I have been facing this issue from last two days but couldn't use either nvm or node. Finally I could fix it. Follow below steps without missing any:

  1. Install nvm from here: https://github.com/coreybutler/nvm-windows/releases

while installing

you will be asked to select the location of node, leave it as it is.

You will be also asked to select the nvm location. Leave it as it is. It is usually inside administrator: C:\Users\administrator\AppData\Roaming\nvm

Remember that nvm installed inside administrator user. So other users can't access it.

  1. Once you install nvm. Check the system environment variables.

Make sure you have below two in your path:

NVM_HOME : C:\Users\administrator\AppData\Roaming\nvm

NVM_SYMLINK : C:\Program Files\nodejs

If they are not set then set the NVM_HOME and NVM_SYMLINK.

Now the nvm is installed. To verify it, if you open command prompt and enter the 'nvm list' command, it will not show up. Since it is installed under user administrator. This is very important.

  1. Now open the command prompt as - Run As Administrator.

Now enter the command and verify.

nvm list

If you have any node version already installed then that node version will show up.

16.17.0

Otherwise you can see that nothing is installed. Now enter the command to install a specific node version. Make sure you mention the arch(arch is 32-bit or 64 bit).

nvm install 14.16.1 64-bit

It will install the node version mentioned. It also installs the npm.

Now you can enter the command to verify the node installations list.

nvm list

Now, nvm is installed, node is installed and npm is also installed. However if you open VSCode terminal and enter the npm it may not work because of the permission issue.

To solve it:

Select the nodejs folder inside C:/Program Files

Right click and select the logged in user.

Give full permissions.

Now restart VSCode. and try the npm or node or nvm commands. All of them work seamlessly. I hope this is useful to someone.

Let me now if you got any issues in the process.

.

Mr ASquare
  • 391
  • 1
  • 8
  • 22
1

Install nvm-windows via chocolatey in cmd prompt admin mode:
> choco install nvm

start a new cmd prompt and run:
> nvm

gurpartap
  • 375
  • 2
  • 9
1

In my case (on Windows 11) it was because my work laptop had been used by a previous domain user from our company before being handed to me, so nvm detected his user profile and installed in C:\Users\SomeOtherUser\AppData\Roaming\nvm instead of C:\Users\MyUser\AppData\Roaming\nvm.

If your problem is like mine, check if %NVM_HOME% points to a folder in a different user profile - e.g. C:\Users\SomeOtherUser\....

Also check if %NVM_SYMLINK% points to an installation within C:\Users\SomeOtherUser\....

sashoalm
  • 75,001
  • 122
  • 434
  • 781
1

This might happen because you  installed NODEJS in normal mode and NVM through the Administrator.

To resolve this, please follow these steps:

  • Please check if the NVM_HOME and NVM_SYMLINK paths are correct or not.
  • Install NVM by doing: nvm install lts
  • Check the node and nvm versions on your machine (node -v and nvm -v).
  • If you need any specific node version, then do nvm install @10.24.1.
  • Then do, nvm use 10.24.1. (you will pointing to node version 10.24.1)
B.Shridhar
  • 11
  • 3
0

Novices and first timers do get unpleasantly surprised with these kind of glitches. Actually there should be a message to reboot in Windows. Using nvm version 1.1.9 (Jul 2022), a reboot in Windows does the needful. And then the variables are all set properly, and nvm command works - verified this..Better to install a stable long term release version of node. After rebooting Windows, use the following command to install node (nvm is just a manager and helps switch between versions of node) and make a note of the version it installs:

nvm install lts

And then using the command prompt (Administrator Mode), use the following command to start using the intended version of node - replace version_as_above with whatever was the output version in the install command above:

nvm use <version_as_above>

Check if node works now using :

node -v
Ravi R
  • 1,692
  • 11
  • 16
0

Restarting windows worked for me after installing nvm package from above link. No other changes were done.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 05 '22 at 12:09
0

Also Edit your User Variables "PATH" :

  • Add -> C:\ProgramFiles\NVM (Directory of NVM)
0

Running the cmd via administrator and tying nvm use 14.15.0 worked.

4b0
  • 21,981
  • 30
  • 95
  • 142
Abel
  • 1
  • Do you mean this to be an answer according to [answer]? In that case please [edit] to make that more obvious. If you want to say thanks for an existing answer or comment here, please delete this non-answer. – Yunnosch Apr 24 '23 at 15:14
0

The issue occurred because when you installed nvm, it wasn't run with admin privileges, so it couldn't create the correct Node.js shortcut in the C:\Program Files folder. You can go to C:\Program Files, delete the incorrect nodejs shortcut that was created, and then run 'nvm use 14' for example. This should resolve the problem.

Johnny
  • 23
  • 4
-1

One MAJOR piece of information that is missing from most of the instructions and answers is that you need to "cd" change directory into the location nvm is installed in.

For instance mine is located at... C:\Users\userName\AppData\Roaming\nvm

Funn_Bobby
  • 647
  • 1
  • 20
  • 57
-2

Here is a workaround to your issue, hope get it solved.

Download and install NVM; you can download a ziped file and unzip to install here: nvm download

After installation, open a new powershell, if you had one running already, close and restart then type the command;

nvm

enter image description here

If you're able to see this on your screen, you're good to go.

I hope this helps!