$ npm start development > mbus-api-play@1.0.1 start > pm2 start ./ecosystem.config.js --env development
Error: EACCES: permission denied, mkdir '/root/.pm2/logs' at Object.mkdirSync (node:fs:1382:3) at mkdirpNativeSync (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/lib/mkdirp-native.js:29:10) at Function.mkdirpSync [as sync] (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/index.js:21:7) at module.exports.Client.initFileStructure (/usr/local/lib/node_modules/pm2/lib/Client.js:133:25) at new module.exports (/usr/local/lib/node_modules/pm2/lib/Client.js:38:8) at new API (/usr/local/lib/node_modules/pm2/lib/API.js:107:19) at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/binaries/CLI.js:22:11) at Module._compile (node:internal/modules/cjs/loader:1155:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10) at Module.load (node:internal/modules/cjs/loader:1033:32) Error: EACCES: permission denied, mkdir '/root/.pm2/pids' at Object.mkdirSync (node:fs:1382:3) at mkdirpNativeSync (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/lib/mkdirp-native.js:29:10) at Function.mkdirpSync [as sync] (/usr/local/lib/node_modules/pm2/node_modules/mkdirp/index.js:21:7) .....
sudo -i 를 사용해 root 사용자로 사용하고 있었다. 권한 문제인 것 같아 root가 아닌 다른 사용자로 프로세스를 시작하려고 했는데 아래와 같은 에러가 나타났다.