Installing the upstream version of node. js on Ubuntu

Source: Internet
Author: User
Tags tar xz install node

Install the upstream version of node. js on Ubuntu Chszs, all rights reserved, without permission, not reproduced. Blogger Home: Http://blog.csdn.net/chszs

node. JS is a software platform that you can use to quickly develop and build scalable Web applications. node. JS uses JavaScript as its scripting language to achieve high throughput through non-blocking I/O and single-threaded event looping mechanisms.
node. JS contains a built-in HTTP server library that allows it to run directly on a Web server without using external software, such as Apache or Nginx, and can provide more control when the Web server is running.
To install node. js on an Ubuntu server, you first need to update the system. In fact, before installing any software packages, you should ensure that the repositories are up-to-date:

# sudo apt-get update

Once the system update is complete, you will need to install the Build-essentials package. This package contains the base library for building Debian packages.

# sudo apt-get install build-essential

You also need to install the Curl tool. Curl is a library that can make HTTP requests on the command line.

# sudo apt-get install curl

After you install curl, you must install all of the packages required by node. js. There are several ways to install node. js, and the simplest way is to do it:

# sudo apt-get install Nodejs

However, the most recent version of node. JS may not have been added to the Ubuntu Standard library. To ensure that the latest version is used, we should download the source code and compile and install it.
First, add the environment variable in the. BASHRC configuration file:

# echo ‘export PATH=$HOME/local/bin:$PATH‘ >> ~/.bashrc# . ~/.bashrc

Then, create the directories that are required for the installation process:

# mkdir ~/{local,node-latest-install}

Then, go to the latest installation directory, download the node. js document using Curl, and unzip it with the Tar tool.

# cd ~/node-latest-install# curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1

Next, set up the parameters to install node. JS and run for the current user:

# ./configure --prefix=~/local# make install

Once node. JS completes the installation, you should then install node. JS's Package Manager NPM,NPM is also the node. JS Official Package Manager.

# curl https://npmjs.org/install.sh | sh

Check whether the installation was successful by looking at the version of node. JS to perform:

# node -v

Ok.

Copyright NOTICE: This article for Bo Master Chszs original article, without Bo Master permission not reproduced.

Installing the upstream version of node. js on Ubuntu

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.