On this information, we will check out how one can set up the newest model of Nodejs and NPM on RHEL-based distributions reminiscent of CentOS, Fedora, Rocky & AlmaLinux and Debian-based distributions reminiscent of Ubuntu & Linux Mint.
Nodejs is a light-weight and environment friendly JavaScript platform that’s constructed primarily based on Chrome’s V8 JavaScript engine and NPM is a default NodeJS package deal supervisor. You need to use it to construct scalable community purposes.
Find out how to Set up Node.js in RHEL Distributions
The most recent model of Node.js and NPM is accessible from the official NodeSource Enterprise Linux repository, which is maintained by the Nodejs web site and you’ll need so as to add it to your system to have the ability to set up the newest Nodejs and NPM packages.
Vital: In case you are operating an older launch of RHEL 6 or CentOS 6, you would possibly wish to examine operating Node.js on older distros.
Putting in NodeJS in RHEL, CentOS, Fedora, Rocky & Alma
So as to add the repository for the newest model of Node.js, use the next command as root or non-root.
------------- For Node.js v19.x ------------- $ curl -fsSL https://rpm.nodesource.com/setup_19.x | sudo bash - $ sudo yum set up -y nodejs ------------- For Node.js v18.x ------------- $ curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash - $ sudo yum set up -y nodejs ------------- For Node.js v16.x ------------- $ curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - $ sudo yum set up -y nodejs ------------- For Node.js v14.x ------------- $ curl -fsSL https://rpm.nodesource.com/setup_14.x | sudo bash - $ sudo yum set up -y nodejs
Non-compulsory: There are growth instruments reminiscent of gcc-c++ and make that that you must have in your system, as a way to construct native addons from npm.
# yum set up gcc-c++ make OR # yum groupinstall 'Growth Instruments'
Find out how to Set up Node.js in Debian, Ubuntu, and Linux Mint
The most recent model of Node.js and NPM can also be out there from the official NodeSource Enterprise Linux repository, which is maintained by the Nodejs web site and you’ll need so as to add it to your system to have the ability to set up the newest Nodejs and NPM packages.
Set up Node.js on Ubuntu and Mint
------------- For Node.js v19.x ------------- $ curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - && $ sudo apt-get set up -y nodejs ------------- For Node.js v18.x ------------- $ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && $ sudo apt-get set up -y nodejs ------------- For Node.js v16.x ------------- $ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && $ sudo apt-get set up -y nodejs ------------- For Node.js v14.x ------------- $ curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash - && $ sudo apt-get set up -y nodejs
Set up Node.js on Debian
------------- For Node.js v19.x ------------- $ curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && $ sudo apt-get set up -y nodejs ------------- For Node.js v18.x ------------- $ curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && $ sudo apt-get set up -y nodejs ------------- For Node.js v16.x ------------- $ curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && $ sudo apt-get set up -y nodejs ------------- For Node.js v14.x ------------- $ curl -fsSL https://deb.nodesource.com/setup_14.x | bash - && $ sudo apt-get set up -y nodejs
Non-compulsory: There are growth instruments reminiscent of gcc-c++ and make that that you must have in your system, as a way to construct native addons from npm.
$ sudo apt-get set up -y build-essential
Testing Newest Nodejs and NPM in Linux
To have a easy take a look at of nodejs and NPM, you possibly can simply examine the variations put in in your system by utilizing the next instructions:
On RHEL-based Programs
# node --version # npm --version
On Debian, Ubuntu, and Linux Mint
$ nodejs --version $ npm --version
That’s it, Nodejs and NPM are actually put in and prepared to be used in your system.
I consider these had been simple and easy steps to observe however in case of issues you confronted, you possibly can tell us and we discover methods of serving to you. I hope this information was useful to you and all the time keep in mind to remain related to Tecmint.
If You Respect What We Do Right here On TecMint, You Ought to Take into account:
TecMint is the quickest rising and most trusted neighborhood website for any form of Linux Articles, Guides and Books on the net. Tens of millions of individuals go to TecMint! to go looking or browse the hundreds of printed articles out there FREELY to all.
For those who like what you’re studying, please contemplate shopping for us a espresso ( or 2 ) as a token of appreciation.
We’re grateful on your by no means ending assist.