Install an older version of the npm package

Learn how to install older versions of npm packages, which may be useful for solving compatibility issues

You can install the old version of the npm package with the following command:@syntax:

npm install <package>@<version>


npm install cowsay

installs version 1.3.1 (at the time of writing).

Use the following command to install version 1.2.0:

npm install [email protected]

The global package can also do this:

npm install -g [email protected]

You may also be interested in listing all previous versions of the package. you can do itnpm view <package> versions:

❯ npm view cowsay versions

[ ‘1.0.0’, ‘1.0.1’, ‘1.0.2’, ‘1.0.3’, ‘1.1.0’, ‘1.1.1’, ‘1.1.2’, ‘1.1.3’, ‘1.1.4’, ‘1.1.5’, ‘1.1.6’, ‘1.1.7’, ‘1.1.8’, ‘1.1.9’, ‘1.2.0’, ‘1.2.1’, ‘1.3.0’, ‘1.3.1’ ]

Download mine for freeNode.js manual

More node tutorials: