I have Node version 16.13.1 installed globally in my machine. I have a project where I want to downgrade the version to 14.19.1. I used the command npm install [email protected] --save-exact to downgrade, and this version is reflecting in my package.json file.
The problem is, when I run node -v at my project's root folder, the version is returned as 16.13.1. To check this, I made an entry in scripts in package.json - "v": "node -v". When I run npm run v, the output is 14.19.1.
It's clear that my project's Node version was downgraded successfully. So, why does Node show me the global version when I check it from my project's folder? Is there flag to use with node -v to check the local version?
To use multiple node versions in your system you have to use nvm. Which is useful to install multiple node versions and easy to switch node versions as per project requirements. NVM Installation Guid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With