nodejs(3)
-
[node.js] Error: listen EADDRINUSE: address already in use :::3000
Node.js로 웹어플리케이션 개발을 하던 중 Error: listen EADDRINUSE: address already in use :::3000 라는 에러가 VSCode 터미널에서 발생하였다. 이는 포트 충돌로 인한 문제이다. 현재 3000번 포트를 사용하고 있는데 이미 3000번 포트가 사용중이라고 해서 포트 충돌이 난 것이다. 해결 방법은 간단하다. 노드에서 터미널 목록을 보면 powershell,cmd,node 터미널 까지 있었다. 나 같은 경우에는 node 터미널을 터미널 리스트에서 삭제해주고 다시 터미널 명령어 치는 부분에서 node app.js를 해주니 정상적으로 코드가 실행된 것을 확인할 수 있었다.
2022.01.27 -
npm 활용해보기 (with ulglify-js)
https://www.npmjs.com/ npm Bring the best of open source to you, your team, and your company Relied upon by more than 11 million developers worldwide, npm is committed to making JavaScript development elegant, productive, and safe. The free npm Registry has become the center of Java www.npmjs.com npm은 Node Package Manager의 약자로 Node.js에서의 앱스토어와 같은 역할이다. npm 페이지 내의 search 기능을 통하여 다양한 npm을 찾을 수 있다...
2022.01.24 -
[Node.js] 공식 홈페이지에 나온 코드 이해해보기
안녕하세요 brandy 입니다 :) 이번 일주일동안(22.1.24~22.1.28)까지 node.js를 활용한 간단한 웹앱 제작 프로젝트를 진행해보려고 합니다. 그러기 전에 node.js에서 제공하는 코드에 대해 충분히 이해하고 넘어가고자 해서 해당 포스팅을 작성하게 되었습니다. const http = require('http'); const hostname = '127.0.0.1'; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/plain'); res.end('Hello World'); }); server.listen(port,..
2022.01.24