Reprint Address Http://www.jb51.net/article/33086.htm
I believe that for many students concerned about the development of JavaScript, Nodejs is not a strange word eye. The relevant information about Nodejs online has been overwhelming. Because of its high concurrency characteristics, it has created its special application status.
At present the highest concern in China, the best maintenance of a website about Nodejs should be http://www.cnodejs.org/
We don't want to talk too much about Nodejs. Just to speak, Windows system under simple NODEJS environment configuration.
First step: Download the installation file
: Official website http://www.nodejs.org/download/
It's used here.
Step Two: Install Nodejs
After the download is complete, double-click Node-v0.8.16-x86.msi to start installing Nodejs, which is installed by default under C:\Program Files\nodejs
Step three: Install the relevant environment
Open the C:\Program Files\nodejs directory you'll find it comes with NPM, which is installed directly with NPM
Entering the node. js Command Prompt Commands window
Enter the Nodejs installation directory C:\Program Files\nodejs
Type the command: CD C:\Program Files\nodejs can be
Start installing the relevant environment now
Type the command: NPM Express enter waiting to install Express .....
Type the command: NPM Jade return waiting to install jade .....
Type the command: NPM MySQL return to wait for the installation of MySQL .....
........ What components to install, depending on the environment to build the requirements
By default, the above components are installed under the C:\Program Files\nodejs\node_modules folder, which is also the auto-find path for NODEJS related components
Fourth step: Create a project
Now there's an express
Type: Express MyApp (MyApp is a random project name)
You'll find one more C:\Program. Files\nodejs\myapp Directory
By default: It is automatically created
These documents, do not explain, I believe that the development experience of students can be a clear glance.
Copy the Node_modules under MyApp
Set up the environment to complete this, the following to do a demo test!
Create a new helloworld.js under MyApp
Copy CodeThe code is as follows:
var http = require ("http");
Http.createserver (function (request, response) {
Response.writehead ($, {"Content-type": "Text/plain"});
Response.Write ("Hello World");
Response.End ();
}). Listen (8888);
Console.log ("Nodejs Start listen 8888 port!");
Enter the node. js Command Prompt Commands window and enter the C:\Program Files\nodejs\myapp directory
Type node Helloworld.js
Open Address http://127.0.0.1:8888/
Discovery Output: Hello World
Simple Nodejs installation and environment configuration under Windows System