인프런 커뮤니티 질문&답변
안녕하세요. 질문 있습니다.
해결된 질문
작성
·
465
0
안녕하세요. 혼자 해결해보려 했으나 잘 되지 않아 질문 드립니다. 도움 부탁드립니다.
우선 로컬에서는 직접 실행도 잘 되고 pm2를 이용한 실행도 잘 되는 것까지 확인했습니다. (node는 16버전 입니다.)
같은 코드를 원격에 올려서 sudo npm run build(cross-env NODE_ENV=production next build) 한후 sudo pm2 start npm -- start(cross-env NODE_ENV=production next start -p 80) 를 하여 실행했습니다.
pm2 같은 경우에는 전역 설치돼 있어서 npx 명령어를 안붙이고 실행했습니다.(붙이고 실행도 해봤습니다)
실행 했을때 잠시 동안은 status가 online이다가 몇초 뒤에 errored로 바뀝니다.
online일때도 errored일때도 ip주소를 통해서 실행은 안됩니다.
에러로그는 아래 로그만 계속 찍히고 있습니다. 혹시 몰라 aws 서버에서 sudo npm run start를 하였는데 아래와 같은 에러가 뜹니다.
강의중 알려주신 lsof -i TCP:80 명령어를 입력 하였을때는 아무것도 찍히지 않습니다.
조언 부탁드립니다. 감사합니다.
```
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
0|npm | Error: listen EACCES: permission denied 0.0.0.0:80
0|npm | at Server.setupListenHandle [as _listen2] (node:net:1355:21)
0|npm | at listenInCluster (node:net:1420:12)
0|npm | at doListen (node:net:1559:7)
0|npm | at processTicksAndRejections (node:internal/process/task_queues:84:21) {
0|npm | code: 'EACCES',
0|npm | errno: -13,
0|npm | syscall: 'listen',
0|npm | address: '0.0.0.0',
0|npm | port: 80
0|npm | }
```





답변 주셔서 감사합니다.
알려주신 명령어를 실행했을때 잠시 status가 online인 리스트가 나온 후 monit으로 인한 화면이 나옵니다 그 후 아래 에러가 계속 반복돼서 출력됩니다.
monit 종료 후 다시 sudo pm2 list 를 입력하면 status가 errored인 프로세스만 남아있습니다.
npm > errno: -13, │
│ ││ npm > syscall: 'listen', │
│ ││ npm > address: '0.0.0.0', │
│ ││ npm > port: 80 │
│ ││ npm > } │
│ ││ npm > > front@1.0.0 start │
│ ││ npm > > NODE_ENV=production next start -p 80 │
│ ││ npm > Error: listen EACCES: permission denied 0.0.0.0:80 │
│ ││ npm > at Server.setupListenHandle [as _listen2] (node:net: │
│ ││ npm > at listenInCluster (node:net:1420:12) │
│ ││ npm > at doListen (node:net:1559:7) │
│ ││ npm > at processTicksAndRejections (node:internal/process/ │
│ ││ npm > code: 'EACCES', │
│ ││ npm > errno: -13, │
│ ││ npm > syscall: 'listen', │
│ ││ npm > address: '0.0.0.0', │
│ ││ npm > port: 80 │
│ ││ npm > } │
│ ││ npm > > front@1.0.0 start │
│ ││ npm > > NODE_ENV=production next start -p 80 │
│ ││ npm > Error: listen EACCES: permission denied 0.0.0.0:80 │
│ ││ npm > at Server.setupListenHandle [as _listen2] (node:net: │
│ ││ npm > at listenInCluster (node:net:1420:12) │
│ ││ npm > at doListen (node:net:1559:7) │
│ ││ npm > at processTicksAndRejections (node:internal/process/ │
│ ││ npm > code: 'EACCES', │
│ ││ npm > errno: -13, │
│ ││ npm > syscall: 'listen', │
│ ││ npm > address: '0.0.0.0', │
│ ││ npm > port: 80 │
│ ││ npm > } │
│ ││ npm > > front@1.0.0 start │
│ ││ npm > > NODE_ENV=production next start -p 80 │
│ ││ npm > Error: listen EACCES: permission denied 0.0.0.0:80 │
│ ││ npm > at Server.setupListenHandle [as _listen2] (node:net: │
│ ││ npm > at listenInCluster (node:net:1420:12) │
│ ││ npm > at doListen (node:net:1559:7) │
│ ││ npm > at processTicksAndRejections (node:internal/process/ │
│ ││ npm > code: 'EACCES', │
│ ││ npm > errno: -13, │
│ ││ npm > syscall: 'listen', │
│ ││ npm > address: '0.0.0.0', │
│ ││ npm > port: 80 │
│ ││ npm > } │
│ ││ npm > > front@1.0.0 start │
│ ││ npm > > NODE_ENV=production next start -p 80 │
│ ││ npm > Error: listen EACCES: permission denied 0.0.0.0:80 │
│ ││ npm > at Server.setupListenHandle [as _listen2] (node:net: │
│ ││ npm > at listenInCluster (node:net:1420:12) │
│ ││ npm > at doListen (node:net:1559:7) │
│ ││ npm > at processTicksAndRejections (node:internal/process/ │
│ ││ npm > code: 'EACCES', │
│ ││ npm > errno: -13, │
│ ││ npm > syscall: 'listen', │
│ ││ npm > address: '0.0.0.0', │
│ ││ npm > port: 80 │
│ ││ npm > } │
│ ││ npm > > front@1.0.0 start │
│ ││ npm > > NODE_ENV=production next start -p 80 │
│ ││ npm > Error: listen EACCES: permission denied 0.0.0.0:80 │
│ ││ npm > at Server.setupListenHandle [as _listen2] (node:net: │
│ ││ npm > at listenInCluster (node:net:1420:12) │
│ ││ npm > at doListen (node:net:1559:7) │
│ ││ npm > at processTicksAndRejections (node:internal/process/ │
│ ││ npm > code: 'EACCES', │
│ ││ npm > errno: -13, │
│ ││ npm > syscall: 'listen', │
│ ││ npm > address: '0.0.0.0', │
│ ││ npm > port: 80 │
│ ││ npm > }