Actually you are trying to perform command of ubuntu/mac on windows.

If you want to install NVM in windows then please refer this step by step guide.

Step by step guide

NVM For Windows

Answer from Dakshesh Baldaniya on Stack Overflow
🌐
GitHub
github.com › nvm-sh › nvm
GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
If you're running a system without prepackaged binary available, which means you're going to install node or io.js from its source code, you need to make sure your system has a C++ compiler. For OS X, Xcode will work, for Debian/Ubuntu based GNU/Linux, the build-essential and libssl-dev packages work. Note: nvm also supports Windows in some cases.
Starred by 90.3K users
Forked by 9.7K users
Languages   Shell 98.0% | Makefile 1.2%
People also ask

Is it possible to install a specific version of NVM?
Yes, you can install a specific version of NVM by specifying the version tag in the install command. Replace v0.35.3 in the curl command with the desired version tag: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm//install.sh | bash.
🌐
monovm.com
monovm.com › 🐧 linux 🐧 › how to install nvm on ubuntu: step-by-step guide
How to Install NVM on Ubuntu: Step-by-Step Guide
Can I use NVM on other operating systems besides Ubuntu?
Yes, NVM is compatible with other Linux distributions and macOS.
🌐
monovm.com
monovm.com › 🐧 linux 🐧 › how to install nvm on ubuntu: step-by-step guide
How to Install NVM on Ubuntu: Step-by-Step Guide
🌐
MonoVM
monovm.com › 🐧 linux 🐧 › how to install nvm on ubuntu: step-by-step guide
How to Install NVM on Ubuntu: Step-by-Step Guide
February 13, 2024 - Compatibility: NVM is highly compatible with Linux, macOS, and WSL (Windows Subsystem for Linux). It does not support native Windows environments without WSL. Ease of Use: Offers a straightforward command-line interface for installing, managing, and switching between Node.js versions.
🌐
AlexHost
alexhost.com › home › faq или база знаний › how to install nvm for node.js on ubuntu
How to Install NVM for Node.js on Ubuntu ⋆ ALexHost SRL
February 12, 2025 - Open a terminal and run: ... This command ensures that all your package lists are up to date. To install NVM, you need to download the installation script from the official NVM repository.
🌐
Javatpoint
javatpoint.com › install-nvm-ubuntu
Install NVM Ubuntu - javatpoint
Install NVM Ubuntu with examples on files, directories, permission, backup, ls, man, pwd, cd, linux, linux introduction, chmod, man, shell, pipes, filters, regex, vi etc.
🌐
Nvmnode
nvmnode.com › guide › download.html
Download NVM For Windows, Linux, and macOS - NVM Documentation
# For Debian/Ubuntu sudo apt install curl wget # For macOS brew install curl wget # For CentOS/RHEL sudo yum install curl wget · On some systems, you can install NVM through a package manager:
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › how-to-install-nvm-on-ubuntu-22-04
How to Install NVM on Ubuntu 22.04 - GeeksforGeeks
July 23, 2025 - Before installing NVM, make sure that the package repository on your system is updated. In a terminal window, press Ctrl + Alt + T and then run the command:
🌐
4Geeks
4geeks.com › how-to › install-nvm-linux
How to Install NVM on Linux (Ubuntu and Centos)
July 15, 2025 - Here are some links if you a looking for a more general guide on installing nvm on every operating system or just installing nvm on mac or installing nvm on windows. Before installing NVM on your Linux system, make sure you have: A standard Linux distribution such as Ubuntu, Debian, CentOS, or Fedora.
🌐
Medium
medium.com › @fieryphoenixtech › installing-nvm-on-ubuntu-basic-node-version-control-14fd00c673c4
Installing NVM on Ubuntu & Basic Node Version Control | by PhoenixIgnited.Tech | Medium
November 21, 2024 - This tutorial goes through installing Node Version Manager (NVM) on Ubuntu / Ubuntu like systems (I am using Linux Mint 21.2 Cinnamon). According to the devs: “nvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.” NVM makes managing different node.js versions extremely simple.
🌐
Host-World
host-world.com › how-to-install-nvm-on-ubuntu-step-by-step-tutorial
【How to Install NVM on Ubuntu: Step-by-Step Tutorial】 BLOG ᐈ Host-World.com
September 10, 2024 - Once the NVM script installation is complete, close the terminal window in which you were working. Launch the terminal window again and source the ~./bashrc file to load the NVM or activate all settings on your Ubuntu system using the following command:
🌐
DEV Community
dev.to › mesonu › simplified-guide-to-installing-nvm-on-ubuntu-3dpa
Simplified Guide to Installing NVM on Ubuntu - DEV Community
June 26, 2024 - #### Conclusion Using NVM on Ubuntu provides flexibility and control over your Node.js environment, making development smoother and more efficient. To know how to install the NVM on Windows please have a look: [How to install NVM(Node Version Manager) on Windows](https://dev.to/mesonu/how-to-install-nvmnode-version-manager-on-windows-2ij1) ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skqz3ml9uk79n5q89eyu.png) To learn about the Docker basics please have a look: [What is Docker and why do we use it?](https://medium.com/@me.sonu300/what-is-docker-and-why-do-we-use-it-c86b11559b3b) Subscribe ·
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › dev-environment › javascript › nodejs-on-wsl
Install Node.js on Windows Subsystem for Linux (WSL2)
Besides choosing whether to install on Windows or WSL, there are additional choices to make when installing Node.js. We recommend using a version manager as versions change very quickly. You will likely need to switch between multiple versions of Node.js based on the needs of different projects you're working on. Node Version Manager, more commonly called nvm, is the most popular way to install multiple versions of Node.js.
🌐
GitHub
gist.github.com › noygal › 6b7b1796a92d70e24e35f94b53722219
Installing node via windows subsystem for linux · GitHub
Enabling wsl with the scripts in Microsoft's guide worked better for me. ... Hi guys, I did have this problem. Anybody did have too? And anybody know how to solve it? Thanks · devel@DESKTOP-GMOMRKS:~$ nvm install --lts Installing latest LTS version.
🌐
SharePoint Lessons
sharepointlessons.wordpress.com › 2020 › 10 › 05 › using-nvm-and-ubuntu-on-windows-to-manage-node-version-collisions
Using NVM and Ubuntu on Windows to Manage Node Version Collisions | SharePoint Lessons
October 5, 2020 - This should allow me to run the original NVM tool inside of Windows without having to use the limited Windows version of the tool. Next, you need a Linux environment so I went to the Windows Store and did a search for Linux. I went with Ubuntu and installed it.
🌐
DEV Community
dev.to › pu-lazydev › installing-nvm-on-windows-wsl-ubuntu-947
Installing NVM on Windows (WSL - Ubuntu) - DEV Community
May 7, 2025 - # 1. Download and run the NVM install script curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash # 2. Load NVM into the current shell session source ~/.bashrc # 3. Verify NVM is installed nvm --version # 4. Install ...
Top answer
1 of 2
18

It looks like it is installed. All OP needs to do is restart the terminal.

In my case, I've installed nvm with this instead

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

Then restarted the terminal, and it is working.

Below will share the full process I've been through to install Node.js in WSL.


First of all, make sure one has WSL installed by following this. In this case OP already did that, so, just in case, would update the system's package

sudo apt-get update

Then, the following will install Node.js on WSL:

  1. Install cURL (a tool used for downloading content from the internet in the command-line)

    sudo apt-get install curl
    
  2. Install nvm (there are alternatives to nvm - see the first note below) (Source)

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
    

    Verify the installation with command -v nvm (it should output nvm)

    Check Node versions available with nvm ls.

  3. Install Node.js.

    There are various options to do that. Here will only consider installing:

    a) Current stable version (recommended for PRD):

    nvm install --lts
    

    b) Current release:

    nvm install node
    
  4. Check Node versions available

    nvm ls
    

  5. Verify Node.js installation node --version (or node -v).

  6. Verify npm installation with npm --version


Notes

  • One might have to restart the terminal after each installation.
  • Additional trouble shooting notes on Linux.
  • There are alternatives to nvm, such as n, fnm,... (more about it)
  • Using Git on WSL.
  • Helpful VSCode extensions.
  • One can also use Node.js with Docker containers remote on WSL. Read more about it.
  • For more about it, read Microsoft's official documentation.
2 of 2
2

I believe this may be because you need to restart your terminal, this is one of the troubleshooting tips given from the NVM github page.

There are not any errors when downloading so it is probably just that the .bashrc file was updated but not ran (you should be able to use source ~/.bashrc instead of restarting)