Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Node.JS different ways to install under Ubuntu 15.04     - ActiveMQ5.11.1 and JDK version matching relation (Linux)

- Laravel configuration PhpStorm + Xdebug + Chrome settings Debug Environment (Server)

- Linux firewall anti-hacker disguise malicious attacks (Linux)

- Haproxy multi-domain certificate HTTPS (Server)

- Docker manage data (Linux)

- Android main thread message system (Handler Looper) (Linux)

- Visual Studio Code experience (Linux)

- CentOS set up FTP server (Server)

- Linux System Getting Started Learning: The Linux command line burn ISO or NRG image to DVD (Linux)

- PHP parsing algorithm of the interview questions (Programming)

- Linux Getting Started tutorial: hard disk partition and to deal with traps (Linux)

- Command line tool Tmux (Linux)

- iOS GCD multithreading simple to use (Programming)

- tar decompression problems gzip: stdin: not in gzip format (Linux)

- Use PuTTY to access the virtual machine Linux under Windows xp (Programming)

- Linux system started to learn: how to view the contents of the seed on the Linux file (Linux)

- How to use Linux to download music from Grooveshark (Linux)

- Objective-C basic program structure (Programming)

- How to use the TF / SD card making Exynos 4412 u-boot boot disk in Mac (Linux)

- C ++ Supplements - malloc free and new delete the same and different (Programming)

 
         
  Node.JS different ways to install under Ubuntu 15.04
     
  Add Date : 2018-11-21      
         
         
         
  If you want to install on Ubuntu 15.04 Node.js, then this tutorial is certainly very important to you. Node.js is essentially a run on the service side of a good package input javascript program output stream. Node.js clever use of single-threaded event loop to handle high throughput and non-blocking IO. It is also provides a read and write files through the operating system and network operating functions of the platform layer. So this article will appear on Ubuntu 15.04 server installation Node.Js of different ways.

Node.JS way to install

There are many different ways to install Node.JS, we can choose one. Through this article we will take you install Node.Js hands on Ubuntu 15.04, before this, please uninstall the old version of the package to avoid package conflicts.

Node.JS install from source
Node.JS install with your package manager
Node.JS install from the remote repository Github
Installation Node.JS with NVM
 
1) Install Node.JS from source

Let's start from the source code is installed Node.JS before, make sure that all dependencies on the system has been updated to the latest version. Then follow these steps to start the installation:

Step 1: Upgrade System

Use the following command to upgrade the system, and install some Node.JS necessary packages.

root @ ubuntu-15: ~ # apt-get update
root @ ubuntu-15: ~ # apt-get install python gcc make g ++
 
Step 2: Get Node.JS source code

After we installed the dependencies can be downloaded from the official website Node.JS source code. Download and unzip command is as follows:

root @ ubuntu-15: ~ # wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz
root @ ubuntu-15: ~ # tar zxvf node-v0.12.4.tar.gz
 
Step 3: Start the installation

Now we come to the source code directory, and then run the file .configure

NodeJS Configure

root @ ubuntu-15: ~ # ls
node-v0.12.4 node-v0.12.4.tar.gz
root @ ubuntu-15: ~ # cd node-v0.12.4 /
root @ ubuntu-15: ~ / node-v0.12.4 # ./configure
root @ ubuntu-15: ~ / node-v0.12.4 # make install
 

After installation test

Just run the above command successfully installed the Node.JS, and now we have to confirm the version information and test whether you can run the following Node.JS output.

root @ ubuntu-15: ~ / node-v0.12.4 # node -v
v0.12.4

Node.Js Test

Create a .js file extension and then run the command with the Node

root @ ubuntu-15: ~ / node-v0.12.4 # touch helo_test.js
root @ ubuntu-15: ~ / node-v0.12.4 # vim helo_test.js
console.log ( 'Hello World');
Now we run the command file with the Node

root @ ubuntu-15: ~ / node-v0.12.4 # node helo_test.js
HelloWorld
And outputs the result proves that we have successfully installed the Node.JS, and we can run the JavaScript file in Ubuntu 15.04.

2) use the package manager to install Node.JS

Node.JS installed in under Ubuntu with your package manager is very simple, as long as the increase NodeSource personal package archive (PPA) can be.

We will be following through PPA installation Node.JS.

Step 1: Get the source code with the curl

Before we get the source code with the curl, we must first upgrade the operating system, and then use the curl command NodeSource get added to the local repository.

root @ ubuntu-15: ~ # apt-get update
root @ ubuntu-15: ~ # curl -sL https://deb.nodesource.com/setup | sudo bash -
curl will run the following tasks

## Installing the NodeSource Node.js 0.10 repo ...
## Populating apt-get cache ...
## Confirming "vivid" is supported ...
## Adding the NodeSource signing key to your keyring ...
## Creating apt sources list file for the NodeSource Node.js 0.10 repo ...
## Running `apt-get update` for you ...
Fetched6,411 B in5s (1,077 B / s)
Readingpackage lists ... Done
## Run `apt-get install nodejs` (as root) to install Node.js 0.10 and npm
 
Step 2: Install and NPM NodeJS

After running the above command if the output of the above, we can use the apt-get command to install NodeJS and NPM package.

root @ ubuntu-15: ~ # apt-get install nodejs

NodeJS Install

Step 3: Install some of the necessary tools

By the following command to install the necessary compile and install some of our native plug.

root @ ubuntu-15: ~ # apt-get install -y build-essential
 
By Node.JS Shell to test

To test Node.JS and use the source code prior to installation is similar to the following command to confirm Node.JS node is fully installed:

root @ ubuntu-15: ~ # node
> Console.log ( 'Node.js Installed Using Package Manager');
Node.js InstalledUsingPackageManager
root @ ubuntu-15: ~ # node
> A = [1,2,3,4,5]
[1,2,3,4,5]
> Typeof a
'Object'
> 5 + 2
7
>
(^ C again to quit)
>
root @ ubuntu-15: ~ #
 

Use a simple test application NodeJS

REPL is a Node.js the shell, any valid JavaScript code can be run through in the REPL. So let's look at Node.JS REPL what it is.

root @ ubuntu-15: ~ # node
> Var repl = require ( "repl");
undefined
> Repl.start ( ">");
PressEnterand it will show out put like this:
> {Domain: null,
_events: {},
_maxListeners: 10,
useGlobal: false,
ignoreUndefined: false,
eval: [Function],
inputStream:
{_connecting: False,
_handle:
{Fd: 0,
writeQueueSize: 0,
owner: [Circular],
onread: [Function: onread],
reading: true},
_readableState:
{HighWaterMark: 0,
buffer: [],
length: 0,
pipes: null,
...
...
The following is a list of commands that can be used in the REPL

REPL Manual

Use NodeJS package manager

NPM is a node script command to the continued vitality of the line tools that can install and manage dependencies by package.json. From the beginning of the initialization command init start

root @ ubuntu-15: ~ # npm init
NPM starting

3) Install Node.JS remote library from Github

In this method, we need some steps to the Node.JS from a remote repository Github cloned into the local repository directory

Before starting clone (clone) packets to the local and preparation, we must first install the following dependencies

root @ ubuntu-15: ~ # apt-get install g ++ curl make libssl-dev apache2-utils git-core
Now we begin to use the git clone command and go to the local directory formulated

root @ ubuntu-15: ~ # git clone git: //github.com/ry/node.git
root @ ubuntu-15: ~ # cd node /
Git Clone NodeJS

After the clone warehouse, compile and generate a complete installation package by running the .config command.

root @ ubuntu-15: ~ # / configure.

Configure Node

After running the make install command wait a few minutes, the program will be installed Node.JS.

root @ ubuntu-15: ~ / node # make install
root @ ubuntu-15: ~ / node # node -v
v0.13.0-pre
 

Test Node.JS

root @ ubuntu-15: ~ / node # node
> A = [1,2,3,4,5,6,7]
[1,2,3,4,5,6,7]
> Typeof a
'Object'
> 6 + 5
11
>
(^ C again to quit)
>
root @ ubuntu-15: ~ / node #
 

4) Install Node.JS by NVM

In the last method we will be relatively easy to install Node.JS. with NVM Installation and preparation Node.JS, which is one of the best way it can for us to choose which version to install.

Before installing, make sure the unit before installation package has been uninstalled.


Step 1: Install dependencies

Upgrading Ubuntu Server system first, and then install the following installation and use NVM Node.JS to be dependent packages. NVM with the curl command to download from a local git repository:

root @ ubuntu-15: ~ # apt-get install build-essential libssl-dev
root @ ubuntu-15: ~ # curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh

NVM Curl

Step 2: Modify the Home Environment

After using curl to download the necessary packages from NVM to the user's home directory, we need to modify the configuration file to add NVM bash, then log in again as long as the interruption or use the following command to update.

root @ ubuntu-15: ~ # source ~ / .profile
Now we can use to set the default NVM NVM version, or use the following command to specify the previous version:

root @ ubuntu-15: ~ # nvm ls
root @ ubuntu-15: ~ # nvm aliasdefault0.12.4

NVM Default

Step 3: Using the NVM

We have successfully installed by NVM Node.JS, so we can now use a variety of useful commands.

NVM Manual

to sum up

Now we are ready to install the service side Node.JS, you can choose the most suitable for your way up in the latest Ubuntu 15.04 installation Node.JS, after installed you can use the Node from four ways we say. JS to write your code.
     
         
         
         
  More:      
 
- Linux command execution judge sentences -;, &&, || (Linux)
- CentOS6 installed Tomcat (Server)
- Ubuntu 14.04 jdk Installation and Configuration (Linux)
- Programmers Do not neglect debugging techniques (Programming)
- Go Languages Reviews (Programming)
- Linux Crontab Timing task command Detailed (Linux)
- Compiled version of Android Opus audio codec library method (Programming)
- Linux beginners to develop the seven habits (Linux)
- JavaScript original values and complex values (Programming)
- Ubuntu install driver manager Mint Driver Manager and Device Driver Manager (Linux)
- NFS-based services and service utilization Corosync DRBD high availability cluster configuration, respectively (Server)
- Oracle 11G R2 DataGuard structures (Database)
- Use FFmpeg processing high quality GIF (Programming)
- Machine Learning: Classification of the curse of dimensionality (Programming)
- Linux System Getting Started Learning: the Linux Wireshark interface dead solve (Linux)
- Turning off the interface eth0: error: Disconnect the device 'eth0' (Linux)
- Linux systems use logwatch log file monitoring (Linux)
- Shell scripts to copy all directories under the current directory of a certain type of file to the same directory (Linux)
- Git build a team development environment operating drills (Linux)
- Linux environment Duplex (multi-machine) automatic mutual backup scheme (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.