sudo npm start && sudo npx pm2 monit 에러
991
작성한 질문수 1
sudo npm start && sudo npx pm2 monit
> node_bird_server@1.0.0 start
> pm2 start app.js
Error: EACCES: permission denied, mkdir '/root/.pm2/logs'
at Object.mkdirSync (node:fs:1005:3)
at mkdirpNativeSync (/home/ubuntu/nodebird/server/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
at Function.mkdirpSync [as sync] (/home/ubuntu/nodebird/server/node_modules/mkdirp/index.js:21:7)
at module.exports.Client.initFileStructure (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Client.js:133:25)
at new module.exports (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Client.js:38:8)
at new API (/home/ubuntu/nodebird/server/node_modules/pm2/lib/API.js:108:19)
at Object.<anonymous> (/home/ubuntu/nodebird/server/node_modules/pm2/lib/binaries/CLI.js:22:11)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
Error: EACCES: permission denied, mkdir '/root/.pm2/pids'
at Object.mkdirSync (node:fs:1005:3)
at mkdirpNativeSync (/home/ubuntu/nodebird/server/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
at Function.mkdirpSync [as sync] (/home/ubuntu/nodebird/server/node_modules/mkdirp/index.js:21:7)
at module.exports.Client.initFileStructure (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Client.js:141:25)
at new module.exports (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Client.js:38:8)
at new API (/home/ubuntu/nodebird/server/node_modules/pm2/lib/API.js:108:19)
at Object.<anonymous> (/home/ubuntu/nodebird/server/node_modules/pm2/lib/binaries/CLI.js:22:11)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
Error: EACCES: permission denied, open '/root/.pm2/module_conf.json'
at Object.openSync (node:fs:490:3)
at Object.writeFileSync (node:fs:1514:35)
at module.exports.Client.initFileStructure (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Client.js:149:10)
at new module.exports (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Client.js:38:8)
at new API (/home/ubuntu/nodebird/server/node_modules/pm2/lib/API.js:108:19)
at Object.<anonymous> (/home/ubuntu/nodebird/server/node_modules/pm2/lib/binaries/CLI.js:22:11)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
Error: EACCES: permission denied, mkdir '/root/.pm2/modules'
at Object.mkdirSync (node:fs:1005:3)
at mkdirpNativeSync (/home/ubuntu/nodebird/server/node_modules/mkdirp/lib/mkdirp-native.js:29:10)
at Function.mkdirpSync [as sync] (/home/ubuntu/nodebird/server/node_modules/mkdirp/index.js:21:7)
at module.exports.Client.initFileStructure (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Client.js:157:25)
at new module.exports (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Client.js:38:8)
at new API (/home/ubuntu/nodebird/server/node_modules/pm2/lib/API.js:108:19)
at Object.<anonymous> (/home/ubuntu/nodebird/server/node_modules/pm2/lib/binaries/CLI.js:22:11)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
-------------
__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
_\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
_\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
_\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
_\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
_\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
_\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
_\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
_\///______________\///______________\///__\///////////////__
Runtime Edition
PM2 is a Production Process Manager for Node.js applications
with a built-in Load Balancer.
Start and Daemonize any application:
$ pm2 start app.js
Load Balance 4 instances of api.js:
$ pm2 start api.js -i 4
Monitor in production:
$ pm2 monitor
Make pm2 auto-boot at server restart:
$ pm2 startup
To go further checkout:
http://pm2.io/
-------------
Error: EACCES: permission denied, open '/root/.pm2/module_conf.json'
at Object.openSync (node:fs:490:3)
at Object.readFileSync (node:fs:391:35)
at Object.Configuration.getAllSync (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Configuration.js:299:26)
at Object.Configuration.getSync (/home/ubuntu/nodebird/server/node_modules/pm2/lib/Configuration.js:270:30)
at new API (/home/ubuntu/nodebird/server/node_modules/pm2/lib/API.js:117:44)
at Object.<anonymous> (/home/ubuntu/nodebird/server/node_modules/pm2/lib/binaries/CLI.js:22:11)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
/home/ubuntu/nodebird/server/node_modules/@pm2/agent/src/InteractorClient.js:58
if (stats.uid === 0) {
^
TypeError: Cannot read property 'uid' of undefined
at /home/ubuntu/nodebird/server/node_modules/@pm2/agent/src/InteractorClient.js:58:21
at FSReqCallback.oncomplete (node:fs:194:21)
npm ERR! code 1
npm ERR! path /home/ubuntu/nodebird/server
npm ERR! command failed
npm ERR! command sh -c pm2 start app.js
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-01-20T17_02_45_173Z-debug.log
위와 같이 에러가 발생하는데 어떤게 문제인지 알수있을까요??
답변 4
0
감사합니다! 말씀하신대로 했더니
[ERROR] Script already launched, add -f option to force re-execution
라는 에러가 또 뜨길래 package.json에서
pm2 start app.js -f
로 강제시켰는데 괜찮겠죠~? ㅎㅎ
0
혹시 해결되었나요? 저도 똑같은 에러가 나와서 여쭤봅니다. 재설치도 해보고 이것저것 해봐도 여전하네요 ㅠ
package.json 다시 node app으로 변경시엔 db연결이 성공적으로 되는데 pm2 start app.js로 변경시에 에러가 뜹니다 ㅠㅠ
넥스트 버젼 질문
0
77
2
로그인시 401 Unauthorized 오류가 뜹니다
0
88
1
무한 스크롤 중 스크롤 튐 현상
0
174
1
특정 페이지 접근을 막고 싶을 때
0
103
2
createGlobalStyle의 위치와 영향범위
0
95
2
인라인 스타일 리렌더링 관련
0
90
2
vsc 에서 npm init 설치시 오류
0
146
2
nextjs 15버전 사용 가능할까요?
0
158
1
화면 새로고침 문의
0
121
1
RTK에서 draft, state 차이가 있나요?
0
153
2
Next 14 사용해도 될까요?
0
452
1
next, node 버전 / 폴더 구조 질문 드립니다.
0
349
1
url 오류 질문있습니다
0
211
1
ssh xxxxx로 우분투에 들어가려니까 port 22: Connection timed out
0
372
1
sudo certbot --nginx 에러
0
1272
2
Minified React error 콘솔에러 (hydrate)
0
469
1
카카오 공유했을 때 이전에 작성했던 글이 나오는 버그
0
246
1
프론트서버 배포 후 EADDRINUSE에러 발생
0
325
1
npm run build 에러
0
518
1
front 서버 npm run build 중에 발생한 에러들
0
381
1
서버 실행하고 브라우저로 들어갔을때 404에러
0
337
2
css 서버사이드 랜더링이 적용되지 않아서 문의 드립니다.
0
286
1
팔로워 3명씩 불러오고 데이터 합쳐주는걸로 바꾸고 서버요청을 무한으로하고있습니다.
0
237
2
해시태그 검색에서 throttle에 관해 질문있습니다.
0
201
1





