In the online article, the installation of node. JS under Linux is compiled using source code, in fact, node GitHub has already provided a way to install node. JS using their own package manager under each system.
1. In Ubuntu, use the following command:
CURL-SL https://deb.nodesource.com/setup | sudo bash-sudoinstall -y Nodejs
If you need to install local components using NPM, you will also need to execute the following command:
Install -y build-essential
2. In Debian, use the following command:
Install-sl https://deb.nodesource.com/setup | bash-install -y Nodejs
If you need to install local components using NPM, you will also need to execute the following command:
Install -y build-essential
3. In Rhel, Fedora, CentOS, use the following command:
CURL-SL https://rpm.nodesource.com/setup | bash-yuminstall -y Nodejs
If you need to install local components using NPM, you will also need to execute the following command:
Yum ' Development Tools ' #下面这行是在Fedora中执行的 sudo Yum Install Nodejs npm# The following line is executed in Rhel and CentOS sudo Yum Install Nodejs npm--enablerepo=epel
But in practice, in CentOS6, the execution
sudo yum install Nodejs npm--enablerepo=epel
The error is not executed, and NPM can be used.
4. In openSUSE and SLE, use the following command:
sudo ar http://DOWNLOAD.OPENSUSE.ORG/REPOSITORIES/DEVEL:/LANGUAGES:/NODEJS/OPENSUSE_13.1/\ node. jssudo in Nodejs nodejs-devel
5. In Arch Linux, use the following command:
Pacman-s Nodejs
6. In FreeBSD and OpenBSD, use the following command:
/usr/ports/www/makeinstall-Rnode-install Install Node-devel
Original address: Https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager.
Installing node. JS with Package Manager in Linux