我们可以使用以下命令来查看当前的 Node 版本:
node -v

接下来创建我的第一个node.js应用
server.js
var http=require("http");//引入http模块
//创建服务器
http.createServer(function(request,response){
//发送http头,状态200:ok,类型:text/plain
response.writeHead(200,{"Content-Type":"text/plain"});
//发送响应数据
response.end("hello cyy");
}).listen(8888);//监听8888端口
console.log("look at localhost:8888");
使用 node 命令执行以上的代码:

浏览器上的页面

来源:https://www.cnblogs.com/chenyingying0/p/12427515.html