티스토리 뷰

dev

node.js 5.x install ubuntu 설치

IT's me 2017. 10. 23. 10:23

node.js 최신판 5.x를 설치해보도록 하자...


1. $ apt-get install curl


2. $ curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -


3. $ apt-get install -y nodejs


4. Hello wolrd 를 작성해보자~ 


에디터를 열어 아래 내용 작성 이름은 server.js ( 적당한 디렉토리에 ) 


var http = require("http");


http.createServer(function(request, response) {

  response.writeHead(200, {"Content-Type": "text/plain"});

  response.write("Hello World");

  response.end();

}).listen(8888);


5. $ node server.js


6. http://localhost:8888 접속~!  Hello world 확인~! 




댓글
최근에 올라온 글
최근에 달린 댓글