Getting started with Linux: how to install Node. js on Linux

Source: Internet
Author: User
Tags install node arch linux linux mint

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:

  1. $ sudoapt-get install npm

In versions earlier than Debian 7 (Wheezy), you need to use the following method for source code installation:

  1. $ sudoapt-get install python g++make
  2. $ wget http://nodejs.org/dist/node-latest.tar.gz
  3. $ tar xvfvz node-latest.tar.gz
  4. $ cd node-v0.10.21(replace a version with your own)
  5. $ ./configure
  6. $ make
  7. $ 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.

  1. $ sudoapt-get install npm
  2. $ 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.

  1. $ sudoapt-get install python-software-properties python g++make
  2. $ sudo add-apt-repository -y ppa:chris-lea/node.js
  3. $ sudoapt-get update
  4. $ 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.

  1. $ sudoyum install npm

If you want to install the latest version of Node. js, follow these steps to install it using the source code.

  1. $ sudoyum groupinstall 'Development Tools'
  2. $ wget http://nodejs.org/dist/node-latest.tar.gz
  3. $ tar xvfvz node-latest.tar.gz
  4. $ cd node-v0.10.21(replace a version with your own)
  5. $ ./configure
  6. $ make
  7. $ 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:

  1. $ 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:

  1. $ 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.

  1. $ 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:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.