1, install nodejs, such as installed in E:\program Files\nodejs (this is my installation path).
Ensure that there are two environment variables
User Environment Variable: C:\USERS\ADMINISTRATOR\APPDATA\ROAMING\NPM
System Environment Variables: E:\Program Files\nodejs
2, installation express, with stable version of 3.5.0, the online information is mostly based on this version, do not specify the version, the default installation of the latest version
Run cmd, npm install-g [email protected]
If it is 4. X version, then install NPM install-g express-generator (if not installed will report "express" is an external command)
3, Express Installation successfully, You can use the command line to create a test app
Run cmd, Express MyApp
4. Copy the dependent module to the root directory of myapp,
Can be copied manually: copy the E:\Program files\nodejs\node_global\node_modules below the Express directory to the app root (pro-test)
You can also execute commands: cmd, CD e:\program files\nodejs\myapp->npm install
5. Install the template engine jade, install Jade to the currently created app below
Run cmd, CD e:\program files\nodejs\myapp, npm install Jade
6. Start myapp, Default url:http://localhost:3000
Run cmd, CD e:\nodejs\myqpp, NPM start or node test.js
Test.js content is
var http=require ("http");
Http.createserver (function (req,res) {
Res.writehead (200,{"content-type": "text/html"});
Res.write ("Res.write ("<p>hello world</p>");
Res.end ("<p>beyondweb.cn</p>");
}). Listen (9999);
Console.log ("nodejs Start listen at Port 9999.");
7, in the browser access open Address http://127.0.0.1:9999/, display Welcome page
Nodejs+express+jade Configuration