nvm allows you to quickly install and use different versions of node via the command line. 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, in particular on these platforms: unix, macOS, and windows WSL.
$ nvm use 16 Now using node v16.9.1 (npm v7.21.1) $ node-v v16.9.1 $ nvm use 14 Now using node v14.18.0 (npm v6.14.15) $ node-v v14.18.0 $ nvm install12 Now using node v12.22.6 (npm v6.14.5) $ node-v v12.22.6
To install or update nvm, you should run the install script. To do that, you may either download and run the script manually, or use the following cURL or Wget command:
Running either of the above commands downloads a script and runs it. The script clones the nvm repository to ~/.nvm and attempts to add the source lines from the snippet below to the correct profile file.
To verify that nvm has installed, do:
$ command-v nvm
which should output nvm if installed successfully. which nvm will not work, since nvm is a sourced shell function, not an executable binary. You need to make sure your system has a C++ compiler before installing nvm.
For windows, you can run nvm through windows subsystem for Linux or by installing nvm-windows.
Usage
To download and install the latest version of node, do this:
$ nvm installnode# "node" is an alias for the latest version
Are you sure you want to delete this article section? You can not undo this change.
Add a Comment
Annotate Article
Share Article
Successfully copied article URL to clipboard!
Something went wrong copying the article URL to the clipboard.
Successfully copied editor state to clipboard!
A previous, saved version of this article is saved. To compare the current version of the article with the previous version - or to replace the current version with the saved version - click the icon above the text editor.
Successfully copied URL to clipboard!
Copied code to clipboard.
Copied TeX code to clipboard.
Uploaded file must be an image of type .jpeg, .jpg, .png, .webp, .gif, .bmp, or .svg.
Image Size must be less than 5MB.
Uploaded file must be an image of type jpeg, jpg, png, webp, avif, tiff, or svg.
Something went wrong uploading the image to the database. Try reloading the page.
The maximum number of images you can upload is 30.
There was an error taking an image using the device's camera. Try uploading an image instead.
Uploaded file must be an audio file.
Audio file must be an audio file of type .m4a, .flac, .mp3, .mp4, .wav, .wma, .aac, .webm, or .mpeg.
Audio file must be less than 300 MB in size.
Something went wrong uploading the audio file. Try reloading the page.
The maximum number of audio files you can upload is 10.
There was an error capturing an audio recording using the device's microphone. Try uploading an audio recording or video instead.
Uploaded file must be an video file.
Video file must be an audio file of type .mp4, .mov, .avi, .wmv, .avchd, .webm, or .flv.
Video file must be less than 300 MB in size.
Something went wrong uploading the video file. Try reloading the page.
The maximum number of video files you can upload is 10.
There was an error taking a video using the device's camera / microphone. Try uploading a video instead.
Comments
You have to be logged in to add a comment
User Comments
There are currently no comments for this article.