The npmjs.com is the centralized repository containing all the node.js modules. Npm download the packages from npmjs and install them on a client machine. By default, NPM installs the latest version of an available module, but sometimes you may be required an older version of the module for your application. This tutorial helps you for installing the old version of modules with NPM command-line tool.

Syntax

The npm specific version installation uses the following syntax: Here pacakgename is the name of the packages and version is the version number to be install.

Installing Specific Version Node Module

The default NPM installs the latest version of the package. But you can specify the version number to install the specific version of a Node.js package. For example, to install the cowsay package with version 1.1.0, type: Similarly, you can install any node modules with the specific version, but the condition is that all the required dependencies are available on the module.

Search Available Package Version’s with NPM

Use the following command to find out all the available versions for a Node.js module. This will show you all the versions from the first version to the current version of the module. Output:

Conclusion

This tutorial describes the instructions to install an older version of node.js modules. Alternatively, you can say to install any specific version of node.js modules.

How To Install Older Version of a NPM Package   TecAdmin - 28