by Sai gowtham

How to install a previous version of an NPM package

Learn, how to install a previous version of an npm package.

Sometimes, when we try to install a npm package using the npm install <package-name> command we will see the node version compatibility errors like this in our terminal.

express requires node version >= 7.0.

To solve it, we can install an older version of the npm package by specifying a version number after the package name.

Example:

npm install express@3.3.8

This above command will install an express version 3.3.8.

You can also install it globally by adding a -g flag to the command.

npm install -g express@3.3.8

Top Udemy Courses

JavaScript - The Complete Guide 2020 (Beginner + Advanced)
JavaScript - The Complete Guide 2020 (Beginner + Advanced)
45,614 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
Vue JS 2 - The Complete Guide (incl. Vue Router & Vuex)
130,921 students enrolled
21 hours of video content
View Course