Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How to Install Node.js in CentOS 7     - Linux - use chroot command (Linux)

- 20 open source / commercial Linux server management control panel (Server)

- Justniffer installed on Ubuntu 15.04 (Linux)

- Java precision four operations (Programming)

- To build PHP environment (Nginx + MariaDB + PHP7) under CentOS 6.5 (Server)

- RCU lock in the evolution of the Linux kernel (Linux)

- Ansible module Know (Linux)

- How to use the DM-Crypt encryption Linux File System (Linux)

- linux server security (Linux)

- Ubuntu 14.10 splash screen brightness settings (Linux)

- How to turn Java String into Date (Programming)

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

- Quick Install software RAID on Linux (Linux)

- Django Web dynamic three linkage (Programming)

- Linux firewall rules example Extracts (Linux)

- Vim (Linux)

- Oracle 11g on Linux system boot from the startup settings (Database)

- grep command Detailed and relevant examples (Linux)

- How to download video youtube-dl in Linux (Linux)

- Linux System Getting Started Learning: complete installation on Debian or Ubuntu kernel source (Linux)

  How to Install Node.js in CentOS 7
  Add Date : 2017-08-31      
  Recently, I have been interested in learning Node.js. This is a server-side Java programming platform, which allows developers to write Java code in the server, and there are many CentOS users are trying to learn the language of the development environment. This is what I want to do this tutorial purposes.

First make sure you have a CentOS 7. Because it is the only thing I use version, of course, there is no absolute guarantee that this guide can also be used in other editions.

From source to install Node.js

First we install from source Node.js. I really like to install the software from source code. Open a new terminal tab and run the following command to download the installation file you want to use on your CentOS 7 machines.

wget http://nodejs.org/dist/v0.12.0/node-v0.12.0.tar.gz

As you can see from the above command, how we use wget to operate.

Then extract the tar file, as shown below.

tar xvf node-v0.12.0.tar.gz

Then use the following command to change the working directory node.

cd node-v *

Before compiling our code, you need to install some packages on CentOS machine, so we can compile. So you open the terminal, enter the following.

sudo yum install gcc gcc-c ++

Wait for the installation and operation of these packages, use the following commands to configure and compile.


Above it will take some time to complete, do not worry because the compiler will take some time. Then use the following command to install on your system Node.js.

sudo make install

After installation is complete, you can start using the Node.js. And to ensure the correct version installed, you can use the following command to check.

node --version

When you run the above command, I get the following message.


How to Install Node.js library from EPEL

Another effective and easy way to install Node.js is from the official repository. This also ensures that you can access to the EPEL repository, you can run the following command.

sudo yum install epel-release

You can now use the yum command to install Node.js.

sudo yum install nodejs

Because I need to manage the development process node packet, I would also like to install a new public management package manager, use the following command.

sudo yum install npm

Write our first Node.js program.

Write Hello World application in Node.js is very easy! Simpler than Python. You need to do is write the following code in a file and save it as something.js.

console.log ( "Hello World");

Us just created saved as hello.js. Then in order to run it, we need to use the following command.

node hello.js

Now open your text editor and add the following code hello.js. You can copy and paste, but I strongly recommend that you enter these yourself because this is a good opportunity to familiarize yourself with the Node.js.

var http = require ( 'http');

http.createServer. (function (request, response) {response.writeHead (200, { 'Content-Type': 'text / plain'}); response.end ( 'Hello World \ n');}) listen (8080 );

console.log ( 'Server started');

Use the following command to run the application.

node hello.js

Now what do you see? This example for beginners, a bit complicated, but it is not difficult to understand. Access your browser to http: / / www.localhost: 8000 /, the above code, it will display "Hello World."

If you want to know more about Node.js content, please visit nodejs.org.

in conclusion

If you find the right guidance and follow the instructions to do it very carefully, I believe that Node.js is not difficult to install on CentOS operating system. I hope this tutorial will help you install it.
- Use IP address spoofing Intrusion Prevention Firewall (Linux)
- A brief description of Java 8 new features introduced syntax (Programming)
- Linux usage in echo (Linux)
- To install and use Docker under linux (Server)
- Netfilter / Iptables Comments (Linux)
- Windows Server 2012 R2 Datacenter install SQL Server 2016 CTP (Database)
- Linux / Centos anti CC attack script (Linux)
- Forgot Linux root password (Linux)
- Detailed Linux su command to switch users Mistakes (Linux)
- Java Class file format parsing (Programming)
- C ++ Const breaking rules (Programming)
- Ubuntu deploying Solr (4.4) to Tomcat (7.0.53) (Server)
- Read the official GNU Make manual one (chapter 1-2) (Programming)
- Configuring a Linux operating system against syn attack (Linux)
- How to use Linux to download music from Grooveshark (Linux)
- MySQL uses mysqld_multi to deploy stand-alone multi-instance detail procedures (Database)
- Configuring the PXE server in Ubuntu 14.04 (Server)
- Linux users should be aware that should the 7 ls command unique skills (Linux)
- Oracle 11g RAC root.sh execution error second node failure example (Database)
- C ++ inheritance and derived (induction principle) (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.