Getting started with Linux: how to install Node. js on Linux
Q: How do I install Node. js on your Linux release?
Node. js is built on Google's V8 JavaScript engine server software platform. Node. js is the preferred solution in JavaScript for building high-performance server-side applications. What makes it so popular to use a huge ecosystem of Node. js libraries and applications to develop backend servers. Node. js comes with a command line tool called npm that allows you to easily install it, perform version control, and manage nodes using npm's online repository. dependencies between js libraries and applications.
In this tutorial, I will introduce how to install Node. js on mainstream Linux distributions, including Debian, Ubuntu, Fedora, and CentOS.
Node. js has pre-built packages (such as Fedora or Ubuntu) on some releases, and you need to install them through source code on other releases. Because Node. js is developing fast, we recommend that you install the latest version from the source code instead of installing an outdated pre-built package. The latest Node. js comes with npm (Node. js Package Manager), allowing you to easily install the Node. js external module.
Install Node. js on Debian
Since Debian 8 (Jessie), Node. js has been incorporated into the official software repository. Therefore, you can install it as follows:
- $ sudoapt-get install npm
In versions earlier than Debian 7 (Wheezy), you need to use the following method for source code installation:
- $ sudoapt-get install python g++make
- $ wget http://nodejs.org/dist/node-latest.tar.gz
- $ tar xvfvz node-latest.tar.gz
- $ cd node-v0.10.21(replace a version with your own)
- $ ./configure
- $ make
- $ sudomake install
Install Node. js in Ubuntu or Linux Mint
Node. js is included in Ubuntu (13.04 and later ). Therefore, the installation is very simple. Install Node. js and npm in the following ways.
- $ sudoapt-get install npm
- $ sudoln-s /usr/bin/nodejs /usr/bin/node
The Node. js version in Ubuntu may be old. You can install the latest version from its PPA.
- $ sudoapt-get install python-software-properties python g++make
- $ sudo add-apt-repository -y ppa:chris-lea/node.js
- $ sudoapt-get update
- $ sudoapt-get install npm
Install Node. js in Fedora
Node. js is included in the base repository of Fedora. Therefore, you can use yum to install Node. js in Fedora.
- $ sudoyum install npm
If you want to install the latest version of Node. js, follow these steps to install it using the source code.
- $ sudoyum groupinstall 'Development Tools'
- $ wget http://nodejs.org/dist/node-latest.tar.gz
- $ tar xvfvz node-latest.tar.gz
- $ cd node-v0.10.21(replace a version with your own)
- $ ./configure
- $ make
- $ sudomake install
Install Node. js in CentOS or RHEL
Use the yum Package Manager in CentOS to install Node. js. First enable the EPEL software library and then run:
- $ sudoyum install npm
If you want to install the latest Node. js version in CentOS, the installation steps are the same as those in Fedora.
Install Node. js on Arch Linux
Node. js can be found in the community library of Arch Linux. So the installation is very simple, as long as you run:
- $ sudo pacman -S nodejs npm
Check the Node. js version
Once you have installed Node. js, you can use the following method to check the Node. js version.
- $ node --version
You may also like the following content about Node. js:
Install and configure Node. js v4.0.0 on Ubuntu 14.04/15.04
How to install Node. js in CentOS 7
Build a Node. js development environment in Ubuntu 14.04
Install and configure the Node. js development environment in javasru 12.04
Getting started with Node. Js [PDF + related Code]
Node. js Development Guide hd pdf Chinese version + source code
Node. js getting started Development Guide
Compile and install Node. js in Ubuntu
Node. js details: click here
Node. js: click here
Via: http://ask.xmodulo.com/install-node-js-linux.html
Author: Dan Nanni Translator: strugglingyou Proofreader: wxy
This article was originally compiled by LCTT and launched with the honor of Linux in China
This article permanently updates the link address: