I believe that for many students concerned about the development of JavaScript, Nodejs has not been a strange word eye. The relevant information about Nodejs has been on the Internet. Because of its high concurrency characteristics, it has created its special application status.
At present, the highest concern in China, the maintenance of the best one about Nodejs website should be http://www.cnodejs.org/
We don't want to talk too much about Nodejs. Just say, Windows system simple NODEJS environment configuration.
First step: Download the installation files
Download Address: 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 begin installing Nodejs, which is installed under C:\Program Files\nodejs
Step three: Install the relevant environment
Open the C:\Program Files\nodejs directory you'll find that it's got npm in it, and you can use NPM to install the environment directly
Enter node.js command prompt commands window
Enter Nodejs installation directory C:\Program Files\nodejs
Type command: CD C:\Program Files\nodejs can
Start the installation of the relevant environment now
Type command: NPM Express carriage return waiting for express ...
Type command: NPM Jade Carriage return waits to install jade ...
Type command: NPM mysql carriage return waits for MySQL to be installed ...
........ What components to install, depending on the environment to build requirements
By default, these components are installed under the C:\Program Files\nodejs\node_modules folder, which is also the automatic lookup path for NODEJS related components
Step Fourth: Create a project
Now there's the Express
Type: Express MyApp (MyApp is a random project name)
You'll find one more C:\Program Files\nodejs\myapp directory
By default: automatically creates
These documents, do not explain, I believe that have developed experience in the students can be a glance.
Copy Node_modules to MyApp below
The environment is built to this completion, the following do a demo test!
Create a new helloworld.js under MyApp
Copy Code code 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