- How To Install Node.js on Linux Mint
- Solution 1: Install Node.js from repositories in Linux Mint
- Step 1.1: Update packages and install Node.js
- Step 1.2: Install npm on Linux Mint
- Step 1.3: Upgrade Node.js which is installed from repositories
- Solution 2: Install Node.js with nvm on Linux Mint
- Step 2.1 Install nvm on Linux Mint
- Step 2.2 List Node versions with nvm
- Step 2.3 Install Node.js with nvm
- Step 2.4 Use multiple Node.js versions with nvm
- Installing Node.js via package manager
- Alpine Linux
- Android
- Arch Linux
- CentOS, Fedora and Red Hat Enterprise Linux
- Alternatives
- Debian and Ubuntu based Linux distributions
- Alternatives
- fnm
- FreeBSD
- Gentoo
- IBM i
- macOS
- Alternatives
- n
- NetBSD
- Nodenv
- nvm
- nvs
- Windows
- macOS,UnixLike
- Usage
- OpenBSD
- openSUSE and SLE
- SmartOS and illumos
- Snap
- Solus
- Void Linux
- Windows
- Alternatives
- z/OS
How To Install Node.js on Linux Mint
Need to install a Node.js in Linux Mint? If so, I’ll show you two ways of installing Node.js on Linux Mint. The two ways are:
Solution 1: Install Node.js from repositories in Linux Mint
Step 1.1: Update packages and install Node.js
It’s a good practice before any installation from the repositories to update the packages. This can be done by:
Then you can install latest available Node.js by next command:
You will need to enter your root password.
Once the installation is complete you can check the version and verify the installation by:
Step 1.2: Install npm on Linux Mint
Many programs like JupyterLab will require npm to be installed in order to work. npm which stands for Node Package Manager can be installed on Linux Mint by:
Step 1.3: Upgrade Node.js which is installed from repositories
Often the installed Node.js version from the repositories will be outdated. If you need to upgrade Node.js to the latest version you can use module n .
The module n will take care for the upgrade of Node.js when it’s installed from PPA.
Then you can install the stable Node.js by:
Note 1: Depending on the OS, versions etc you may need to use sudo.
Note 2: There was a naming problem in the past for package node in Ubuntu. Which causes coexistence of node and nodejs commands in Linux Mint. Some programs will require nodejs others node . This should be handled with alias. You can check the output of the next command in order to find what versions do you have:
Solution 2: Install Node.js with nvm on Linux Mint
The second way which is better and my preferred one is installing nvm and using it to install node.
Step 2.1 Install nvm on Linux Mint
The nvm installation guide is available on : nvm Install & Update Script. So in order to install nvm on Linux Mint you can follow. Get the latest installation script from the page above:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
Note 1: this will download and run the script. If you like you can download it, review it and then install it.
Note 2: You need to start a new terminal or run command: source ~/.bashrc in order to use nvm command.
Step 2.2 List Node versions with nvm
There are many different node packages available. In order to list all of them with nvm you can use command:
v14.14.0 v14.15.0 (LTS: Fermium) -> v14.15.1 (Latest LTS: Fermium) v15.0.0 v15.0.1 v15.1.0 v15.2.0 v15.2.1 v15.3.0 v15.4.0
Step 2.3 Install Node.js with nvm
When you find what version you like to use then you can install it by:
Step 2.4 Use multiple Node.js versions with nvm
It’s common to have several Node.js versions. The best way to manage them is with nvm . Local Node.js versions can be listed by:
v12.18.3 -> v14.15.1 system default -> node (-> v14.15.1) iojs -> N/A (default) unstable -> N/A (default) node -> stable (-> v14.15.1) (default) stable -> 14.15 (-> v14.15.1) (default) lts/* -> lts/fermium (-> v14.15.1) lts/argon -> v4.9.1 (-> N/A) lts/boron -> v6.17.1 (-> N/A) lts/carbon -> v8.17.0 (-> N/A) lts/dubnium -> v10.23.0 (-> N/A) lts/erbium -> v12.20.0 (-> N/A) lts/fermium -> v14.15.1
If you need to change the default one you can do it by:
Finally, check the Node version by:
By using SoftHints — Python, Linux, Pandas , you agree to our Cookie Policy.
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.
Alpine Linux
Node.js LTS and npm packages are available in the Main Repository.
Node.js Current can be installed from the Community Repository.
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.
dnf module install nodejs:
where corresponds to the major version of Node.js. To see a list of available streams:
For example, to install Node.js 18:
dnf module install nodejs:18/common
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.
fnm
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:
cd /usr/ports/www/node && make install
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:
curl "https://nodejs.org/dist/latest/node-$node-(.*)\.pkg.*|\1|p')>.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"
Alternatives
port install nodejs # Example port install nodejs7
Install the binary package:
Or build manually from pkgsrc:
cd pkgsrc/lang/nodejs && bmake install
n
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 (bootstrap, 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:
cd /usr/pkgsrc/lang/nodejs && make install
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.
nvm
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:
env VERSION=`python tools/getnodeversion.py` make install DESTDIR=`nvm_version_path v$VERSION` PREFIX=""
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:
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 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:
$ nvs use lts PATH -= %LOCALAPPDATA%\nvs\default PATH += %LOCALAPPDATA%\nvs\node\14.17.0\x64
To add it to PATH permanently, use nvs link :
OpenBSD
Node.js is available through the ports system.
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:
cd pkgsrc/lang/nodejs && bmake install
Snap
Node.js snaps are available as node on the Snap store.
Solus
Solus provides Node.js in its main repository.
sudo eopkg install nodejs
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
winget install OpenJS.NodeJS # or for LTS winget install OpenJS.NodeJS.LTS
After running one of the two commands above, it may be necessary to restart the terminal emulator before the node CLI command becomes available.
cinst nodejs # or for full install with npm cinst nodejs.install
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:
Copyright OpenJS Foundation and Node.js contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.