CentOS installation Nodejs and express development framework

Source: Internet
Author: User

This article demonstrates the installation of the Nodejs and Express development Framework on LinuxNote: I downloaded the latest version of Nodejs on the http://www.nodejs.org/official website Nodejs v0.10.29 but in./configure, said no path found, helpless under, Had to reduce the Nodejs version to v0.10.24. now let's write down the running steps to avoid forgetting in the future.

The installation process is as follows: Step 1, confirm that the server has Nodejs compiled and dependent software, if not can be installed by running the following command.

[Email protected] local]# yum-y install gcc gcc-c++ openssl-devel
Step 2, download Nodejs source package and unzip.

[Email protected] local]# wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz[[email protected] local]# tar ZXVF Node-v0.10.24.tar.gz[[email protected] local]# CD node-v0.10.24
Step 3, configure, compile, install.

[Email protected] node-v0.10.24]#/configure--prefix=/usr/local/node[[email protected] node-v0.10.24]# make & & Make Install
Step 4, next Configure the node environment

[Email protected] node-v0.10.24]# Vim/etc/profile
#set nodejs envexport node_home=/usr/local/nodeexport path= $NODE _home/bin: $PATHexport node_path= $NODE _home/lib/node _modules: $PATH [[email protected] node-v0.10.24]# Source/etc/profile    
  - -Restart effectiveStep 5, test whether the installation is successful

[Email protected] node-v0.10.24]# node-vv0.10.24
the Nodejs version number appears to indicate OK. Step 6, Nodejs's Hello world

output: Hello NodeJS, I ' m bob.zStep 7, install the Express development framework

[[email protected] local]# NPM install Express-g
Step 8, create demo project

Step 9, enter the project directory and install the project dependent components

[[Email protected] local]# CD Demoapp[[email protected] demoapp]# NPM Install
Step 10, start the app after the dependent component installation is complete

[[Email protected] demoapp]# node appexpress server listening on port 3000

finally through the browser to access server 3000 port, page display,Express

Welcome to Express


node + Express runs successfully and successfully opens node development journey, enjoy it!

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.