When you try to work on a project that requires a specific version of node that is different from you installed version, then the easiest and safest way is to use nvm:
- nvm (Node Version Manager) is an excellent tool for this. If you’re on Windows, there’s an alternative called nvm-windows.
- After installing
nvm
, you can switch to a compatible version easily:bash nvm install 16 # This installs Node.js version 16 nvm use 16 # This switches to use version 16
- After installing