Home > Web Front-end > JS Tutorial > Quickly master Node.js and configure NodeJs environment under Window_node.js

Quickly master Node.js and configure NodeJs environment under Window_node.js

WBOY
Release: 2016-05-16 15:10:00
Original
1688 people have browsed it

I also tried it under window, it was installed perfectly and the test passed!

1. Download node

Download node at https://nodejs.org/en/, I chose the stable version on the left

2. Install node

Install the downloaded node step by step as shown below

3. After installation, check whether the node is successfully installed

After installation, there will be a command window on the window start button

Check the node version after opening it

4. Install global Express

5. Check whether Express is installed successfully

6.demo test

1).Create helloWorld.js

var http = require("http");
 
http.createServer(function(request, response) {
 
response.writeHead(200, {"Content-Type": "text/plain"});
 
response.write("Hello World");
 
response.end();
 
}).listen(8899);
 
console.log("nodejs start listen 8899 port!");

Copy after login

2). Place helloWorld.js in the F:nodejsnode_modulesnpmtest directory

3). Start output

Use the command line to point to the upper-level directory of helloWorld.js and start express

7.

Run results

Enter http://127.0.0.1:8899 in the browser, the output result is as follows

Author: L'Oréal Paris

The above is the entire content of this article, I hope it will be helpful to everyone’s study.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template