CentOS installation Nodejs and express development framework

Source: Internet
Author: User
This article demonstrates installing the NODEJS and Express development Framework on Linux
Software Environment:VMware 9 CentOS 6.5 Nodejs v0.10.24
installation process:Step 1, verify that the server has Nodejs compiled and dependent software, if not can be installed by running the following command.

[root@bobserverstation local]# yum-y install gcc gcc-c++ openssl-devel
Step 2, download the Nodejs source package and unpack.

[Root@bobserverstation local]# wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz [root@bobserverstation local]# tar zxvf node-v0.10.24.tar.gz [root@bobserverstation local]# c D node-v0.10.24
Step 3, configuration, compilation, installation.

[Root@bobserverstation node-v0.10.24]#./configure--prefix=/usr/local/node [Root@bobserverstation node-v0.10.24]# && make install will continue to 3-4min ....
Step 4, then configure the node environment

[Root@bobserverstation node-v0.10.24]# Vim/etc/profile


#set Nodejs env Export Node_home=/usr/local/node export path= $NODE _home/bin: $PATH export node_path= $NODE _home/lib/node _modules: $PATH
[Root@bobserverstation node-v0.10.24]# source/etc/profile--Restart effective
Step 5, test whether the installation was successful

[Root@bobserverstation node-v0.10.24]# Node-v

v0.10.24 the Nodejs version number appears ok.
Step 6, Nodejs's Hello World

[Root@bobserverstation node-v0.10.24]# node

> Console.log ("Hello Nodejs, I ' m bob.z");

Hello Nodejs, I ' m bob.z

Undefined

> Output: Hello nodejs, I ' m bob.z
Step 7, the installation of Express development framework

[root@bobserverstation local]# npm Install Express-g
Step 8, create demo project

[Root@bobserverstation local]# Express DEMOAPP

[Root@bobserverstation local]# CD DEMOAPP

[Root@bobserverstation demoapp]#
Step 9, enter the project directory and install the project dependency component

[Root@bobserverstation local]# CD DEMOAPP

[Root@bobserverstation demoapp]# NPM Install
Step 10, start the app after the dependent component installation is complete

[Root@bobserverstation demoapp]# node app

Express Server listening on port 3000
Finally through the browser Access server 3000 port, page display, Express

Welcome to Express

Related Article

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.