1、下载node for mac并一路默认安装

Mac上安装node.js

2、测试成功否

Mac上安装node.js

3、copy this file to test(save as javascript file)

var http = require('http');

http.createServer(function(request,response){
    response.writeHead(200,{'Content-Type':'text/plain'});
    response.end('hello world\n');
}).listen(8888);

console.log('Server running at http://127.0.0.1:8888/');

cd到正确路径下

Mac上安装node.js

打开浏览器,出现输入地址和端口号

Mac上安装node.js

 

yeah you succeed!

相关文章:

  • 2021-11-01
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
  • 2022-01-20
  • 2021-09-12
  • 2021-08-12
猜你喜欢
  • 2021-09-03
  • 2021-04-08
  • 2021-06-30
  • 2022-12-23
  • 2021-04-01
  • 2021-09-18
相关资源
相似解决方案