Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How to Install Node.js in CentOS 7     - Use Oracle 11g show spparameter command (Database)

- Binary Tree Traversal (Linux)

- C ++ type conversion and RTTI (Programming)

- Linux 4.0+ kernel support for hardware switching module (HW Switch Offload) (Linux)

- MySQL5.6.12 Waiting for commit lock lead to hang from the library housing problem analysis (Database)

- Security: Unix operating system intrusion tracking Strikes Back (Linux)

- Linux / UNIX: Use the dd command to create a 1GB size binary (Linux)

- Installation of JDK and Tomcat under Linux (CentOS) (Linux)

- How nodeclub constructed Docker image (Server)

- SSH without password Definitive Guide (Linux)

- XenServer Virtual Machine Installation --- first ISO image file storage expansion (Linux)

- Linux file system structure Introduction (Linux)

- Linux / Unix: chroot command examples to explain (Linux)

- Linux iptables: combat scenes (Linux)

- To compile and install Redis Linux and master-slave replication configuration (Database)

- Close Pycharm spell check (Programming)

- Installing software on Ubuntu: apt-get and dpkg difference (Linux)

- Use netcat [nc] command on Linux and Unix port scan (Server)

- How to monitor network usage by nload in Linux (Linux)

- See Shell Script Linux Server network traffic (Server)

  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.
- Linux POST fstab configuration file read-only variable can not be modified problem (Linux)
- To add the Oracle JDBC driver in Maven repository (Linux)
- OpenGL ES 3.0 vertex buffer (Programming)
- Linux command find (Linux)
- Linux operating system set up to effectively prevent ARP attacks (Linux)
- Git large file storage will help handle large binary files (Linux)
- MySQL binlog automatic cleanup script (Database)
- Understand the profound discussion of some of the options for wireless encryption (Linux)
- MySQL thread cache thread_cache_size parameter optimization (Database)
- CentOS7 + Redis Live Installation and Configuration (Linux)
- Use HttpClient remote interface testing (Programming)
- Oracle online redefinition (Database)
- MySQL partition summary (Database)
- Ten to improve the efficiency of the Linux bash tricks (Linux)
- Character Encoding notes: ASCII, Unicode and UTF-8 (Linux)
- Expert advice: Do not use the computer security IE browser (Linux)
- OpenStack image production in the CentOS 6.2 (Linux)
- CentOS 6.5 configuration SSDB 1.8.0 (Server)
- SUSE Linux firewall configuration notes (Linux)
- Ora-14450: attempt to access ah transactional temptable already in use (Database)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.