Installing Node.js via package manager

Note: The packages on this page are maintained and supported by their respective packagers, not by the core team .js Node. Report any problems you encounter to the package maintainer. If it turns out that your problem is an error in Node.js itself, the maintainer will report the problem upstream.

    Alpine Linux

  • Android
  • Arch
  • Linux

  • CentOS, Fedora and Red Hat Enterprise
  • Linux

  • Debian and Ubuntu Linux-based distributions fnm
  • FreeBSD

  • Gentoo
  • IBM i
  • macOS
  • n
  • NetBSD

  • Nodenv
  • nvm nvs
  • OpenBSD
  • openSUSE and SLE
  • SmartOS e illumos
  • Snap
  • Solus
  • Void
  • Linux

  • Windows z/OS
  • Alpine Linux

The Node.js LTS, and npm packages are available in the master repository.

Apk Add Nodejs

npm Node.js Current can be installed from the community repository

. apk add nodejs-current

Android

Android support is still experimental in Node.js, so Node .js developers don’t provide precompiled binaries yet

.

However, there are some third-party solutions. For example, the Termux community provides terminal emulator and Linux environment for Android, as well as its own package manager and extensive collection of many precompiled applications. This command in the Termux application will install the latest available version of

Node.js: pkg install nodejs Currently,

binaries .js Termux node are bound against system-icu (depending on the libicu package).

The Arch

Linux Node.js and npm packages

are available in the community repository

. pacman -S nodejs npm CentOS, Fedora and

Red Hat Enterprise Linux

Node.js is available as a module called nodejs on CentOS/RHEL 8 and Fedora. Installation of the DNF module nodejs

: <stream>

where <stream> corresponds to the major version of Node.js. To view a list of available streams

: List of DNF nodejs modules For

example, to install

Node.js 18: Installing the DNF module nodejs:18/common For CentOS

/RHEL 7 Node.js is available through Software Collections

.

Alternatives

These resources provide packages compatible with CentOS, Fedora, and RHEL.

Node.js snaps maintained and supported on https://github.com/nodejs/snap Node.js binary distributions maintained and supported by NodeSource

Linux

distributions based on Debian and Ubuntu Node

  • .js binary distributions
  • are available

  • on
  • NodeSource

.

Alternatives

Packages compatible with Debian- and Ubuntu-based Linux distributions are available through

Node.js snaps.

FNM

Quick and simple node.js version manager built into Rust used to manage multiple

versions of Node.js

released. It allows you to perform operations like installing, uninstalling, changing Node versions automatically based on the current directory, etc. To install fnm, use this installation script.

fnm has cross-platform support (macOS, Windows, Linux) and all popular shells (Bash, Zsh, Fish, PowerShell, Windows Command Line Prompt). FNM is built with speed and compatibility support for .node-version and .nvmrc files in mind.

FreeBSD

The latest version

of Node.js is available through the www/node port.

Install a binary package via

pkg: pkg install node

Or compile it on your own using

ports: cd /usr/ports/www/node && make install

Gentoo

Node

.js is available in the portage tree

. emerge nodejs IBM

i

LTS versions of Node.js are available from IBM, and are available through the ‘yum’ package manager. The package name is nodejs followed by the major version number (for example

, nodejs12, nodejs14, etc.) To install Node.js

14.x from the command line, run the following as a user with the special authority *ALLOBJ:

yum install nodejs14

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 website

.

If you want to download the package with bash

: curl “https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE ‘s|. *>node-(.*)\.pkg</a>.*|\1|p’)}.pkg” > “$HOME/Downloads/node-latest.pkg” && sudo installer -store -pkg “$HOME/Downloads/node-latest.pkg” -target “/”

Alternatives

Using

Homebrew

: brew install node

Using MacPorts

: port install nodejs<major version> # Port example install nodejs7 Using pkgsrc:

Install the binary package

: pkgin -y install nodejs

Or manually compile

from pkgsrc: cd

pkgsrc

/lang/nodejs && bmake install n

n

is an easy-to-use Node version manager .js for Mac and Linux. Specify the target version you want to install using rich syntax, or select it from a menu of previously downloaded versions. Versions are installed system-wide or user-wide, and for more targeted use, you can run a version directly from cached downloads.

See the home page for installation methods (bootstrap, npm, Homebrew, third parties) and all usage details.

If you already have npm, installing n and then the latest version of the LTS node is as simple as: npm

install -g n n lts

NetBSD

Node.js is available in the

pkgsrc tree: cd /usr/pkgsrc/lang/nodejs && make install

Or install a binary package (if available for your platform) using pkgin: pkgin

-y install nodejs

Nodenv

Nodenv is a lightweight node version manager, similar to NVM. It’s simple and predictable. A rich ecosystem of plugins allows you to tailor it to your needs. Use nodenv to choose a node version for your application and ensure that your development environment matches production.

Nodenv’s installation instructions are maintained on their Github page. Please visit that page to make sure you’re following the latest version of the installation steps.

nvm

Node Version Manager is a bash script used to manage multiple released versions .js Node. It allows you to perform operations like installing, uninstalling, changing versions, etc. To install nvm, use this installation script.

On Unix/OS X Node systems.js built from source can be installed using nvm by installing in the location nvm expects:

env VERSION=’python tools/getnodeversion.py’ make install DESTDIR=’nvm_version_path v$VERSION’ PREFIX=””

After this, you can use nvm to switch between published versions and versions created from source. For example, if the Node.js version is v8.0.0-pre

: nvm use 8 Once the official version

comes out, you’ll want to uninstall the version created from source:

nvm uninstall 8 nvs 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 installation file of the latest version.

You can also use chocolatey To install it

: choco install nvs macOS,UnixLike

You can find the documentation on the steps of installing nvs on systems similar to macOS/Unix here

Usage

After this

,

you can use nvs to

switch between different versions of

node. To add the latest version of the node: nvs add newer OR to add the

latest LTS version of

the node: nvs add lts Then run the nvs use command to add

a node version to your PATH for the current shell

:

$ nvs use lts PATH -= %LOCALAPPDATA%\nvs\default PATH += %LOCALAPPDATA%\nvs\node\14.17.0\x64

To add it to PATH permanently, use

nvs link: nvs link lts OpenBSD Node.js is available through the port system. /usr/ports/lang/node Using

OpenBSD

pkg_add: pkg_add openSUSE node and SLE

Node.js is available in the master 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:

zypper install nodejs14

Different major versions of Node can be installed and used simultaneously

. SmartOS

images and SmartOS images

come with pkgsrc pre-installed. In other illumos distributions, first install pkgsrc, then you can install the binary package as usual: pkgin -y install nodejs OR manually compile from pkgsrc: cd pkgsrc/lang/nodejs && bmake install

Snap Node.js

snaps are available as a node in the Snap store

.

Solus Solus

provides Node.js in its master repository. sudo eopkg install nodejs Void Linux

Void Linux

sends Node.js stable in the master repository

. xbps-install -Sy nodejs Windows

Download Windows

Installer directly from the nodejs.org website.

Alternatives

using Winget

: winget install OpenJS.NodeJS # or for LTS winget install OpenJS.NodeJS.LTS

After running one of the above two commands, it may be necessary to restart the terminal emulator before the node CLI command is available

. Using

Chocolatey

: cinst nodejs # or for full installation with npm cinst nodejs.install Using Scoop: scoop install nodejs # or for LTS

scoop

install nodejs-lts z/OS 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:

Installing and configuring the SMP/E edition of Node.js on z/OS

  • Installing and configuring the PAX edition of Node.js on z/OS