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!