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