Installing a specific version of an npm package, something that will help to solve compatibility issues.
You can use the below command for installing a specific version of a npm package.
npm install <package>@<version>
Example
Below will install the current verion of the axios.
npm install axios
If you want to install the verions 0.22.0 you can use the below.
npm install axios@0.22.0
For installing it as global package, run the following command:
npm install -g axios@0.22.0
For listing all the previous version of a package. You can do it with npm view <package> versions
.
npm view axios versions
For tree-structured list of all your locally installed packages, including their dependencies, run the following command:
npm list
For viewing the packages inserted globally, run the following command:
npm list -g
For viewing the verion of a specific package, run the following command:
npm list axios
Use the share button below if you liked it.
It makes me smile, when I see it.