nodejs报错

nodejs报错_第1张图片


端口3000已被使用,换成其他(比如4000),就可以了。

var http = require('http');
http.createServer(function(req,res){
    res.writeHead(200,{'Content-Type': 'text/html'});
    res.write('

Node.js

'); res.end('

Hello World, Good Morning!

'); }).listen(4000); console.log("HTTP server is listening at port 4000.");


监听端口改为4000,在浏览器中输入http://localhost:4000/,显示:

nodejs报错_第2张图片

你可能感兴趣的:(nodejs,nodejs)