The version management tools of nodejs include: 1. nvm tool; supported on macOS, Linux and various other Unix-like systems, but Windows support is not good. 2. n tool; no subshell, no configuration file settings, no complex API. 3. nodenv tool.
The operating environment of this tutorial: windows7 system, nodejs version 12.19.0, Dell G3 computer.
Why do you need version management tools?
In a situation where various npm packages using different versions of Node.js are flying all over the front end, in order to solve the incompatibility phenomenon of various versions of Node.js, version management Tools allow you to quickly install and switch between different versions of Node.js on the same machine.
If you want to test modules developed with the latest cutting-edge version without uninstalling node stable versions, version management tools can help.
What are the version management tools for nodejs?
nvm
nvm’s full name is Node.js Version Management. As the name suggests, it is a Node.js version management tool. Supported on macOS, Linux (including Windows Subsystem for Linux), and various other Unix-like systems. Due to poor Windows support, the community hatched nvm-windows for Windows, which were part of different projects and supported and maintained separately from each other.
Linux, Mac OS: https://github.com/nvm-sh/nvm
Windows: https://github.com/coreybutler/nvm-windows
n
Node.js version management: no subshell, no configuration file settings, no complex API, just simple. The same system support as nvm, supported on macOS, Linux (including Windows Subsystem for Linux), and various other Unix-like systems.
Linux, Mac OS: https://github.com/tj/n
Windows: Must work through WSL (Windows Subsystem for Linux)
nodenv
Node.js version management tool forked from rbenv, use nodeenv to select a Node version for your application and ensure that your development environment matches your production environment match. Use nodeenv with npm for painless Node upgrades and bulletproof deployments.
https://github.com/nodenv/nodenv
##nvm installation (Windows version)
1. Download the installation package
https://github.com/coreybutler/nvm-windows/releasesDownload and get the latest nvm-setup.zip file.
2. Install nvm
3. Verify after installation
Open CMD and run the nvm command. The version number and command help will appear. The installation is successful.nodejs tutorial"]
The above is the detailed content of What are the version management tools for nodejs?. For more information, please follow other related articles on the PHP Chinese website!