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:
๐ŸŒ
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.
Find elsewhere
๐ŸŒ
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.
๐ŸŒ
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:
๐ŸŒ
LinuxVox
linuxvox.com โ€บ blog โ€บ nvm-install-ubuntu
Installing NVM on Ubuntu: A Comprehensive Guide โ€” linuxvox.com
Node Version Manager (NVM) is a crucial tool for developers working with Node.js on Ubuntu. It allows you to easily switch between different versions of Node.js, enabling you to manage projects that require specific Node.js versions. This blog post will walk you through the process of installing NVM on Ubuntu, its usage methods, common practices, and best practices.
๐ŸŒ
TecAdmin
tecadmin.net โ€บ how-to-install-nvm-on-ubuntu-20-04
How To Install NVM on Ubuntu 20.04 โ€“ TecAdmin
April 26, 2025 - Here is the step-by-step instructions to install and use NVM on Ubuntu systems.
๐ŸŒ
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 โ€บ 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 ...
๐ŸŒ
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 ยท
๐ŸŒ
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.
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)

๐ŸŒ
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.