1. Download the node. JS official Windows Edition program:
: http://nodejs.org/#download
After entering the page, select Download, then select either the Windows installer,32 bit or 64-bit according to your own configuration.
2. After the download is complete, double click on the installation, here tentative I was installed under the E:\NodeJs\ directory.
After the installation is complete, run node. js Command Prompt, enter node-v in the Prompt window, and the correct installation will output the current node. JS version number.
Here you can write a test program to test whether node. JS is working properly, with the following code:
var http = require ("http");
Http.createserver (function (request, response) {
Response.writehead ($, {"Content-type": "Text/plain"});
Response.Write ("Test Nodjs");
Response.End ();
}). Listen (8899);
Console.log ("Nodejs Start listen 8899 port!");
Save the above code to a text file and save as Test.js (directory location is optional).
In the node. js command Prompt, enter the directory where the file is located, and type node test.js.
Open http://127.0.0.1:8899/in the browser to see the output of test Nodjs, the Environment installation configuration is successful.
3. Download NPM Source code
: Https://github.com/isaacs/npm/tags
Extract the NPM source code into the E:\NPM directory (the directory can be placed at your own request).
Perform the following actions in the node. js Command Prompt window
E:\>CD NPM
E:\npm>node Cli.js INSTALL-GF
Or
Node Cli.js install NPM-GF//The latest version of NPM can be installed
After the NPM installation is complete, add "D:\nodejs\node_modules" to the system environment variable Node_path.
The current version number is displayed when the command Prompt window is entered npm-v installed correctly.
4. Install Express
Execute "NPM Install-g Express" on the command line waiting to download and complete the installation automatically. One way to test Express installation is to look at its version number, and execute the command "express-v" to output the version number normally, but in the event of an abnormal condition, "Express is not an internal or external command". There are two possibilities: one is to install node in the second step without adding environment variables, which will solve the environment variables added by node. Second, the Express 4.x version of the command tool is divided, you need to install a command tool, execute the command "NPM install-g Express-generator" After the completion of the test.
Nodejs+express deployment process under Windows