Install a specific version of npm package
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 axiosIf you want to install the verions 0.22.0 you can use the below.
npm install axios@0.22.0For installing it as global package, run the following command:
npm install -g axios@0.22.0For listing all the previous version of a package. You can do it with npm view <package> versions.
npm view axios versionsFor tree-structured list of all your locally installed packages, including their dependencies, run the following command:
npm listFor viewing the packages inserted globally, run the following command:
npm list -gFor viewing the verion of a specific package, run the following command:
npm list axios