Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Programming»Nodejs»How To Install Older Version of a NPM Package

    How To Install Older Version of a NPM Package

    RahulBy RahulJune 26, 20212 Mins ReadUpdated:July 4, 2021

    NPM (Node Package Manager) is a command-line tool for managing node modules for Node.js applications. It is used to install, update or delete a node module in your system. It also follows the pacakge.json file for proper management of node modules for an application.

    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:

    npm install [packagename]@[version]
    

    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:

    npm install [email protected] 
    
    Installing Specific Version Node Module
    Installing Specific Version Node Module

    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.

    npm view cowsay versions 
    

    Output:

    [
      '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',
      '1.4.0', '1.5.0'
    ]
    

    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.

    module node NodeJs npm package
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Create a Sudo User in CentOS
    Next Article How to Backup SQL Server Database

    Related Posts

    How To Install Node.js on Ubuntu 22.04

    Updated:May 27, 20223 Mins Read

    How To Install NVM on Ubuntu 22.04

    Updated:April 16, 20223 Mins Read

    How To Install NVM on Windows

    Updated:April 16, 20223 Mins Read

    How To Install Node.Js on Debian 11

    Updated:February 11, 20226 Mins Read

    How To Install NVM on Debian 11

    Updated:August 31, 20213 Mins Read

    How To Use Environment Variables in Node.js

    6 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • Filesystem Hierarchy Structure (FHS) in Linux
    • How to accept user input in Python
    • What is difference between var, let and const in JavaScript?
    • What is CPU? – Definition, Types and Parts
    • What is the /etc/aliases file
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.