Home  >  Article  >  Web Front-end  >  Install node.js_node.js using package manager in linux

Install node.js_node.js using package manager in linux

WBOY
WBOYOriginal
2016-05-16 16:09:452824browse

In online articles, source code compilation is used to install node.js under Linux. In fact, node’s github has provided methods for installing node.js under each system using their own package managers.

1. In Ubuntu, use the following command:

Copy code The code is as follows:

curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs

If you need to use npm to install local components, you also need to execute the following command:

Copy code The code is as follows:

apt-get install -y build-essential

2. In Debian, use the following command:

Copy code The code is as follows:

apt-get install curl
curl -sL https://deb.nodesource.com/setup | bash -
apt-get install -y nodejs

If you need to use npm to install local components, you also need to execute the following command:

Copy code The code is as follows:

apt-get install -y build-essential

3. In RHEL, Fedora, CentOS, use the following command:

Copy code The code is as follows:

curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs

If you need to use npm to install local components, you also need to execute the following command:

Copy code The code is as follows:

yum groupinstall 'Development Tools'
#The following line is executed in Fedora
sudo yum install nodejs npm
#The following line is executed in RHEL and CentOS
sudo yum install nodejs npm --enablerepo=epel

However, in practice, in CentOS6, execute

Copy code The code is as follows:

sudo yum install nodejs npm --enablerepo=epel

An error will be reported without execution. You can also use npm.

4. In openSUSE and SLE, use the following command:

Copy code The code is as follows:

sudo zypper ar
http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/
Node.js
sudo zypper in nodejs nodejs-devel

5. In Arch Linux, use the following command:

Copy code The code is as follows:

pacman -S nodejs

6. In FreeBSD and OpenBSD, use the following command:

Copy code The code is as follows:

/usr/ports/www/node
cd /usr/ports/www/node-devel/ && make install clean
#or
pkg_add -r node-devel
pkg install node
#or
pkg install node-devel

The above is the entire content of this article, I hope you all like it.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn