- Installing Node.js via package manager
- Android
- Arch Linux
- CentOS, Fedora and Red Hat Enterprise Linux
- Alternatives
- Debian and Ubuntu based Linux distributions
- Alternatives
- FreeBSD
- Gentoo
- IBM i
- macOS
- Alternatives
- NetBSD
- Nodenv
- Windows
- macOS,UnixLike
- Usage
- OpenBSD
- openSUSE and SLE
- SmartOS and illumos
- Solus
- Void Linux
- Windows
- Alternatives
- Installation of Node.js on Linux
- How to Install Latest NodeJS and NPM in Linux
- How to Install Node.js 14 in CentOS, RHEL, and Fedora
- Installing NodeJS 14.x in RHEL, CentOS and Fedora
- Installing NodeJS 12.x on RHEL, CentOS and Fedora
- Installing NodeJS 10.x on RHEL, CentOS and Fedora
- How to Install Node.js 14 in Debian, Ubuntu and Linux Mint
- Installing NodeJS 14.x in Debian, Ubuntu and Linux Mint
- Installing NodeJS 12.x in Debian, Ubuntu and Linux Mint
- Installing NodeJS 10.x in Debian, Ubuntu and Linux Mint
- Testing Latest Nodejs and NPM in Linux
- On RHEL, CentOS, and Fedora
- On Debian, Ubuntu and Linux Mint
- If You Appreciate What We Do Here On TecMint, You Should Consider:
Installing Node.js via package manager
Note: The packages on this page are maintained and supported by their respective packagers, not the Node.js core team. Please report any issues you encounter to the package maintainer. If it turns out your issue is a bug in Node.js itself, the maintainer will report the issue upstream.
Android
Android support is still experimental in Node.js, so precompiled binaries are not yet provided by Node.js developers.
However, there are some third-party solutions. For example, Termux community provides terminal emulator and Linux environment for Android, as well as own package manager and extensive collection of many precompiled applications. This command in Termux app will install the last available Node.js version:
Currently, Termux Node.js binaries are linked against system-icu (depending on libicu package).
Arch Linux
Node.js and npm packages are available in the Community Repository.
CentOS, Fedora and Red Hat Enterprise Linux
Node.js is available as a module called nodejs in CentOS/RHEL 8 and Fedora.
where corresponds to the major version of Node.js. To see a list of available streams:
For example, to install Node.js 12:
For CentOS/RHEL 7 Node.js is available via Software Collections.
Alternatives
These resources provide packages compatible with CentOS, Fedora, and RHEL.
Debian and Ubuntu based Linux distributions
Alternatives
Packages compatible with Debian and Ubuntu based Linux distributions are available via Node.js snaps.
Fast and simple Node.js version manager built in Rust used to manage multiple released Node.js versions. It allows you to perform operations like install, uninstall, switch Node versions automatically based on the current directory, etc. To install fnm, use this install script.
fnm has cross-platform support (macOS, Windows, Linux) & all popular shells (Bash, Zsh, Fish, PowerShell, Windows Command Line Prompt). fnm is built with speed in mind and compatibility support for .node-version and .nvmrc files.
FreeBSD
The most recent release of Node.js is available via the www/node port.
Install a binary package via pkg:
Or compile it on your own using ports:
Gentoo
Node.js is available in the portage tree.
IBM i
LTS versions of Node.js are available from IBM, and are available via the ‘yum’ package manager. The package name is nodejs followed by the major version number (for instance, nodejs12 , nodejs14 etc)
To install Node.js 14.x from the command line, run the following as a user with *ALLOBJ special authority:
Node.js can also be installed with the IBM i Access Client Solutions product. See this support document for more details
macOS
Download the macOS Installer directly from the nodejs.org web site.
If you want to download the package with bash:
Alternatives
Using Homebrew:
Using MacPorts:
Using pkgsrc:
Install the binary package:
Or build manually from pkgsrc:
n is a simple to use Node.js version manager for Mac and Linux. Specify the target version to install using a rich syntax, or select from a menu of previously downloaded versions. The versions are installed system-wide or user-wide, and for more targeted use you can run a version directly from the cached downloads.
See the homepage for install methods (boostrap, npm, Homebrew, third-party), and all the usage details.
If you already have npm then installing n and then the newest LTS node version is as simple as:
NetBSD
Node.js is available in the pkgsrc tree:
Or install a binary package (if available for your platform) using pkgin:
Nodenv
nodenv is a lightweight node version manager, similar to nvm . It’s simple and predictable. A rich plugin ecosystem lets you tailor it to suit your needs. Use nodenv to pick a Node version for your application and guarantee that your development environment matches production.
Nodenv installation instructions are maintained on its Github page. Please visit that page to ensure you’re following the latest version of the installation steps.
Node Version Manager is a bash script used to manage multiple released Node.js versions. It allows you to perform operations like install, uninstall, switch version, etc. To install nvm, use this install script.
On Unix / OS X systems Node.js built from source can be installed using nvm by installing into the location that nvm expects:
After this you can use nvm to switch between released versions and versions built from source. For example, if the version of Node.js is v8.0.0-pre:
Once the official release is out you will want to uninstall the version built from source:
Windows
The nvs version manager is cross-platform and can be used on Windows, macOS, and Unix-like systems
To install nvs on Windows go to the release page here and download the MSI installer file of the latest release.
You can also use chocolatey to install it:
macOS,UnixLike
You can find the documentation regarding the installation steps of nvs in macOS/Unix-like systems here
Usage
After this you can use nvs to switch between different versions of node.
To add the latest version of node:
Or to add the latest LTS version of node:
Then run the nvs use command to add a version of node to your PATH for the current shell:
To add it to PATH permanently, use nvs link :
OpenBSD
Node.js is available through the ports system.
Using pkg_add on OpenBSD:
openSUSE and SLE
Node.js is available in the main repositories under the following packages:
- openSUSE Leap 15.2: nodejs10 , nodejs12 , nodejs14
- openSUSE Tumbleweed: nodejs16
- SUSE Linux Enterprise Server (SLES) 12: nodejs10 , nodejs12 , and nodejs14 (The «Web and Scripting Module» must be enabled.)
- SUSE Linux Enterprise Server (SLES) 15 SP2: nodejs10 , nodejs12 , and nodejs14 (The «Web and Scripting Module» must be enabled.)
For example, to install Node.js 14.x on openSUSE Leap 15.2, run the following as root:
Different major versions of Node can be installed and used concurrently.
SmartOS and illumos
SmartOS images come with pkgsrc pre-installed. On other illumos distributions, first install pkgsrc, then you may install the binary package as normal:
Or build manually from pkgsrc:
Node.js snaps are available as node on the Snap store.
Solus
Solus provides Node.js in its main repository.
Void Linux
Void Linux ships Node.js stable in the main repository.
Windows
Download the Windows Installer directly from the nodejs.org web site.
Alternatives
Using Chocolatey:
Using Scoop:
IBM® SDK for Node.js — z/OS® is available in two installation formats, SMP/E and PAX. Select the installation format that applies to you:
В© OpenJS Foundation. All Rights Reserved. Portions of this site originally В© Joyent.
Источник
Installation of Node.js on Linux
Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js can be installed in multiple ways on your Ubuntu Linux machine. You can use Ubuntu’s official repository to install Node.js or another way to use NodeSource repository. Installation via NodeSource repository will allow you to choose latest version of Node.js.
Installing Node On Ubuntu 18.04 and 16.04: There are two methods Ubuntu official repository and NodeSouce repository to install Node.js on Ubuntu.
Install Node.js using Ubuntu official repository: Node.js is available in Ubuntu’s repository and you can easily install it using a few commands. Follow the steps below to install Node.js on your Ubuntu operating system.
- Step 1: Open your terminal or press Ctrl + Alt + T.
- Step 2: To install node.js use the following command:
sudo apt install nodejs
Step 3: Once installed, verify it by checking the installed version using the following command:
node -v or node –version
Note: It is recommended to install Node Package Manager(NPM) with Node.js. NPM is an open source library of Node.js packages.
To install NPM, use the following commands:
sudo apt install npm
npm -v or npm –version
Node and NPM will be successfully installed on your Ubuntu machine.
Install Node.js using NodeSouce repository: The latest version of Node.js can be installed from NodeSource repository. Follow the steps below to install the Node.js on your Ubuntu.
- Step 1: Open your terminal or press Ctrl + Alt + T and use the following commands to update and upgrade the package manager:
sudo apt-get update
sudo apt-get upgrade
Step 2: Install Python software libraries using the following command:
sudo apt-get install python-software-properties
Step 3: Add Node.js PPA to the system.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash –
Note: Here, we are installing node.js version 10, if you want to install version 11, you can replace setup_10.x with setup_11.x.
Step 4: To Install Node.js and NPM to your Ubuntu machine, use the command given below:
sudo apt-get install nodejs
Step 5: Once installed, verify it by checking the installed version using the following command:
node -v or node –version
npm -v or npm –version
Источник
How to Install Latest NodeJS and NPM in Linux
In this guide, we shall take a look at how you can install the latest version of Nodejs and NPM in RHEL, CentOS, Fedora, Debian, and Ubuntu distributions.
Nodejs is a lightweight and efficient JavaScript platform that is built based on Chrome’s V8 JavaScript engine and NPM is a default NodeJS package manager. You can use it to build scalable network applications.
On this page:
How to Install Node.js 14 in CentOS, RHEL, and Fedora
The latest version of Node.js and NPM is available from the official NodeSource Enterprise Linux repository, which is maintained by the Nodejs website and you will need to add it to your system to be able to install the latest Nodejs and NPM packages.
Important: If you are running an older release of RHEL 6 or CentOS 6, you might want to read about running Node.js on older distros.
Installing NodeJS 14.x in RHEL, CentOS and Fedora
To add the repository for the latest version of Node.js 14.x, use the following command as root or non-root.
Installing NodeJS 12.x on RHEL, CentOS and Fedora
If you want to install NodeJS 12.x, add the following repository.
Installing NodeJS 10.x on RHEL, CentOS and Fedora
If you want to install NodeJS 10.x, add the following repository.
Adding Node.js Repository in CentOS
Next, you can now install Nodejs and NPM on your system using the command below:
Install NodeJS in CentOS
Optional: There are development tools such as gcc-c++ and make that you need to have on your system, in order to build native addons from npm.
Install Development Tools in CentOS
How to Install Node.js 14 in Debian, Ubuntu and Linux Mint
The latest version of Node.js and NPM is also available from the official NodeSource Enterprise Linux repository, which is maintained by the Nodejs website and you will need to add it to your system to be able to install the latest Nodejs and NPM packages.
Installing NodeJS 14.x in Debian, Ubuntu and Linux Mint
Installing NodeJS 12.x in Debian, Ubuntu and Linux Mint
Installing NodeJS 10.x in Debian, Ubuntu and Linux Mint
Optional: There are development tools such as gcc-c++ and make that you need to have on your system, in order to build native addons from npm.
Testing Latest Nodejs and NPM in Linux
To have a simple test of nodejs and NPM, you can just check the versions installed on your system by using the following commands:
On RHEL, CentOS, and Fedora
On Debian, Ubuntu and Linux Mint
That is it, Nodejs and NPM are now installed and ready for use on your system.
I believe these were easy and simple steps to follow but in case of problems you faced, you can let us know and we find ways of helping you. I hope this guide was helpful to you and always remember to stay connected to Tecmint.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Источник