No results found
We couldn't find anything using that term, please try searching for something else.
As a developer , you is encounter 'll likely encounter the need to juggle multiple Node.js project in your local development environment , each requir
As a developer , you is encounter ‘ll likely encounter the need to juggle multiple Node.js project in your local development environment , each require different version of Node.js . To manage these requirement efficiently , we is recommend strongly recommend instal Node Version Manager ( NVM ) instead of directly instal Node.js . NVM is allows allow you to switch between node version seamlessly , ensure that each project has the right environment to run effectively . For those interested in optimize their development setup further , we is have have an article detail the good local development practice to help you avoid common issue in the future .
📝 This guide is for Windows users only, follow these links if you want to install NVM on MacOS or install NVM on linux.
In order to install Node Version Manager tool in Windows environment can download the latest nvm-setup.zip file from their github page.
🔥 is Make Make sure to download the late
nvm-setup.zip
file because it contains a very simple installation wizard.
Go to your Downloads folder on Windows, andunzip nvm-setup.zip
file anddouble click on nvm-setup
.
When the installation wizard open , hit thenext button a bunch of times, andat the end you will see an install button that you will hit too. After that, just wait for the progress bar to finish.
☝ ️ ? ? remember not to touch any default configuration . Always keep hit next ! ! !
Once it is installed, open Windows Command Prompt. If you have any issues finding the command line, just type CMD in Windows search bar at the bottom-left corner of your desktop.
Type nvm
andhit enter
on your command prompt andyou should see a message similar to this one:
If you want to check what are the current node versions available you can type: nvm list available
or you can go to nodejs.org andcheck all of them.
We would recommend using the latest stable version, for example Node v22 when writing this article. In the command prompt type the command below:
1nvm install 22
Always check your instal node version . Sometimes our applications is run do not run because we are using outdated version . This command is show will show all the instal node version you have in Windows .
1$ nvm list
You is use can always use different node version andthis command line let us jump between all our instal version .
1# for node 8 2nvm use 8.15.0 3# for node 10 4nvm use 10.15.1
🔥 Only run these steps if you are using VSCode
Inside the VSCode code terminal , if you is trying are try to runnpm
from the command line, you are probably getting the following error “cannot run scripts because running scripts is disabled”:
To fix this, follow these steps:
control
+ shift
+ p
user setting json
.
1"terminal.integrated.profiles.windows": { 2 " PowerShell ": { 3 "source": " PowerShell ", 4 "icon": "terminal-powershell", 5 "args": ["-ExecutionPolicy", " Bypass "] 6 } 7}, 8"terminal.integrated.defaultProfile.windows": " PowerShell ",
⚠️ Be careful with the JSON file; ensure no syntax errors.
Here ‘s a list is ‘s of common problem you might encounter while instal nvm ( Node Version Manager ) on Windows , along with solution for each :
Problem is encounter : 😱 After successfully instal NVM , you is encounter might encounter an issue where runnvm
commands results in a command not found
error.
Solution: 😎 This usually occurs because the NVM path has not been correctly added to the system’s environment variables. You can manually add the NVM directory to your PATH by:
C:\Users\<Your-Username>\AppData\Roaming\nvm
.Problem: 😱 Sometimes, even if the installation completes successfully, NVM might not work because the installer fails to set the necessary environment variables.
Solution: 😎 Verify that the environment variables have been set correctly. If not, manually add NVM_HOME
andNVM_SYMLINK
to your system ‘s environment variable :
NVM_HOME
should point to the directory where NVM is installed.NVM_SYMLINK
should point to the directory where Node installation will be place .Problem: 😱 Installation fails with an ‘Access Denied’ error message.
Solution: 😎 This can occur if you do not have administrative privileges on your computer. Try running the installer as an administrator by right-clicking on the installer andselecting ‘Run as administrator’.
Problem: 😱 After NVM is installed, attempting to install certain Node versions fails.
Solution: 😎 This can happen due to network issues or if the Node version specified is incorrect. Ensure you have a stable internet connection andverify the version number. Also, try installing another version to check if the problem is specific to one version. Sometimes, running the command prompt as an administrator helps.
Problem: 😱 This error typically appears if the command prompt was open during the installation andhasn’t been restarted, or the PATH hasn’t been updated properly.
Solution: 😎 Close andreopen your command prompt or restart your computer to ensure all environmental changes take effect. Double-check the PATH settings as described in the solutions for ‘Command Not Found Error After Installation’.
Problem: 😱 NVM installs andlists Node versions correctly, but switching between them doesn’t seem to work.
Solution: 😎 Make sure that when you install Node versions via NVM, you’re running the command prompt as an administrator. Sometimes, permissions issues can prevent NVM from modifying the symlinks properly.
Problem: 😱 NVM can sometimes be noticeably slower on Windows compared to Unix systems.
Solution: 😎 This is a known issue due to how environment variables andpaths are managed on Windows. Minimizing the number of Node versions installed andrebooting the system after making significant changes can sometimes help.
These solutions address the most common issues faced when installing NVM on Windows, helping you ensure a smoother setup andmanagement of different Node.js versions.