Quickly master Node. configure the node. js environment in the js Window and configure the node. js environment quickly in the Window. If you are interested, you can refer to it and try it in the window. The installation is complete and the test passes!
1. Download node
Download node at https://nodejs.org/en/and select the stable version on the left.
2. Install node
Install the downloaded node step by step.
3. Check whether node is successfully installed after installation.
After installation, a command window is displayed at the start of window.
Check the node version after enabling
4. Install Global Express
5. Check whether Express is successfully installed.
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!");
2) Place helloWorld. js in the F: \ nodejs \ node_modules \ npm \ test directory.
3). Start the output
Use the command line to point to the upper-level directory of helloWorld. js and start express
7.
Running result
Enter http: // 127.0.0.1: 8899 in the browser. The output result is as follows:
By l'oreal Paris
The above is all the content of this article, hoping to help you learn.