Install Node via PM
Most modern GNU/Linux systems have a stable version of this platform in their repositories. Therefore, it is enough to execute the installation command.
Npm is needed to add third-party packages to Node.
Note! On some systems, npm needs to be installed as a separate package. Usually, the necessary developer tools and additional platform modules are loaded with it.
|Debian-based||apt update && apt install nodejs npm|
|Arch-based||pacman -Sy && pacman -S nodejs npm|
|Void Linux||xbps-install -Sy nodejs|
To view the platform’s version, run:
The npm version can be recognized in the same way:
This method is basic to “Red Hat”-based systems. The following steps add the repository of the newest Node’s version and then install it.
curl -sL https://rpm.nodesource.com/setup_12.x | bash - yum install -y nodejs
There is the newest version for Ubuntu:
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - apt install -y nodejs
Important! Node 10.x and below is not working on 32-bit systems.
Node Version Manager manages multiple platforms on a single computer. In order for it to work in the OS, development tools in C must be installed. In Debian-based OS, the packages are build-essential checkinstall libssl-dev
Then write the line to load the text for install nvm:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
After that, restart the console.
For installing a specific platform, simply specify it as a parameter:
nvm install 12.11.1
You can also see a list of already installed versions of Nodes:
Option use allows selecting a working version:
nvm use 12.11.1
For deleting a specific version, you must deactivate and uninstall it:
nvm deactivate 12.11.1 nvm uninstall 12.11.1
Additional information and some nuances of managing the platform on various operating systems can be found in README.md on the project’s Github page.