Facebooktwitterredditpinterestlinkedintumblr

If you’ve ever encountered the “nvm command not found” error, you know it can be frustrating. Fortunately, you can do a few things to fix the issue and get your Node Version Manager installation up and running again.

This article will walk you through the steps for fixing the nvm command not found error on Linux, Windows, and Mac.

What is NVM?

nvm (Node Version Manager) is a program for downloading and installing Node.js. With nvm, you can easily switch between multiple versions of Node.js from the command line, without having to go into any configuration files or directories.

What is Node.js?

The Node.js platform is an open-source, cross-platform back-end JavaScript runtime that utilizes the V8 engine and executes JavaScript code outside of a web browser.

Developers can use Node.js to write command-line tools in JavaScript and server-side scripting—writing scripts on the server to generate dynamic web page content before it’s sent to the client’s web browser.

How to Check if nvm is Installed?

To solve the issue with the “nvm command not found” error, check if your system can find the nvm command.

Run this command:

$ nvm – version
bash: nvm: command not found

If you see the error “nvm: command not found,” it means nvm isn’t installed on your system. If it was installed, it’s now corrupted, and you should follow these steps to fix the issue.

How to Reinstall nvm?

If you’re not able to run nvm, you can reinstall it by following these steps depending on the operating system you’re running.

On Linux:

If you’re using Linux, the process for fixing the “nvm command not found” error is try restarting your computer and then try uninstalling and reinstalling nvm using your system’s package manager.

To uninstall and reinstall nvm on Linux:

  • Open a Terminal window and download nvm by running this command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
  • Close your Terminal window and reopen a new Terminal window.
  • Check if nvm is working now by running:
$ nvm – version
0.39.1

This should fix the issue and allow you to start using Node.js on your Linux system again.

If it doesn’t work, you can reload the configuration by running this command:

source ~/.bashrc

On Mac:

If you’re getting the “nvm command not found” error on a Mac, the first thing you’ll want to do is restart your computer and try again. If that doesn’t work, try uninstalling and reinstalling nvm using Homebrew.

To uninstall nvm:

brew uninstall nvm

To install nvm:

brew update
brew install nvm
  • Close your Terminal window and reopen a new Terminal window.
  • Check if nvm is working now by running:
% nvm – version
0.39.1

This should fix the issue and allow you to start using Node.js on your Linux system again.

This should resolve the issue and allow you to start using Node.js again on your Mac.

On Windows:

If you’re getting the “nvm command not found” error on Windows, you can reinstall nvm.

  • Follow the setup installer.
  • Once the setup installer has completed, open a Command Prompt.
  • Verify nvm has been installed successfully by running:
C:\>nvm version
1.1.9

You should now be able to use nvm on your Windows computer without any issues.

Conclusion

If you’re seeing the “nvm command not found” error, there are a few things you can do to fix the issue. First, try restarting your computer and then try uninstalling and reinstalling nvm.

If that doesn’t work, try adding an entry for nvm to your PATH environment variable. With any luck, one of these solutions will get you up and running with Node.js again.

Leave a Comment