*
1, download path
https://nodejs.org/en/download/
2, install Express (previously with NPM Install-g Express, has been prompted to error, and then check the data said Nodejs if it is more than 4,
should use Express-generator)
D:\RESOURCES\NODEJS\NODEJS>NPM Uninstall-g Express
NPM WARN Uninstall not installed in D:\Resources\NODEJS\nodejs\node_modules: "Express"
D:\RESOURCES\NODEJS\NODEJS>NPM install-g Express-generator
D:\Resources\NODEJS\nodejs\express-D:\Resources\NODEJS\nodejs\node_modules\express-generator\bin\express
[Email protected] D:\Resources\NODEJS\nodejs\node_modules\express-generator
├──[email protected]
├──[email protected] ([email protected])
└──[email protected] ([email protected])
D:\resources\nodejs\nodejs>express-v
4.13.4
Create a HelloWorld Project
D:\resources\nodejs\nodejs>express HelloWorld
Create:helloworld
Create:helloworld/package.json
Create:helloworld/app.js
Create:helloworld/public/javascripts
Create:helloworld/public/images
Create:helloworld/public/stylesheets
Create:helloworld/public/stylesheets/style.css
Create:helloworld/routes
Create:helloworld/routes/index.js
Create:helloworld/routes/users.js
Create:helloworld/public
Create:helloworld/views
Create:helloworld/views/index.jade
Create:helloworld/views/layout.jade
Create:helloworld/views/error.jade
Create:helloworld/bin
Create:helloworld/bin/www
helloworld.js//////
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!");
****************
D:\RESOURCES\NODEJS\NODEJS>CD HelloWorld
D:\resources\nodejs\nodejs\helloworld>node Helloworld.js
Nodejs Start Listen 8888 port!
Open Address http://127.0.0.1:8888/
Discovery Output:
Hello World
From
*****************
1,cmd window, input node, enter, enter "Console.log (" Hello "), you can simply test node. js
*
Nodejs Environment Configuration