Reputation: 172
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?
Upvotes: 3
Views: 13361
Reputation: 1
You can use NVM, it's work for me if you want to use multiple node version
Upvotes: 0
Reputation: 508
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
Upvotes: 4