When using pm2-runtime process.yml current working directory passed to NodeJS script become: ./process.yml/ as a "directory parameters" or somethings similar.
Set "cwd" app's option configuration in process.yml does not made any difference, seems completely ignored.
I follow Docker guide and created a process.yml file:
apps:
- script: ./node_modules/nuxt-start/bin/nuxt-start.js
name: 'app'
instances: 'max'
exec_mode: cluster
env:
NODE_ENV: 'production'
then set Docker entrypoint to /usr/bin/pm2-runtime process.yml (guide suggest to use CMD ["pm2-runtime", "process.yml"] that has the same effect) and Nuxt fail during start-up:
Error: No build files found in /app/process.yml/.nuxt/dist/server.
my app reside in /app (as volume), so you can notice the wrong CWD "/app/process.yml/" passed to script.
--- PM2 report ----------------------------------------------------------------
Date : Thu Jan 09 2020 16:52:39 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 4.2.1
node version : 10.17.0
node path : not found
argv : /usr/bin/node,/usr/bin/pm2-runtime,process.yml,--only,app
argv0 : node
user : undefined
uid : 0
gid : 0
uptime : 0min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 4.2.1
node version : 10.17.0
node path : not found
argv : /usr/bin/node,/usr/bin/pm2,report
argv0 : node
user : undefined
uid : 0
gid : 0
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
cpus nb : 8
freemem : 253816832
totalmem : 16698138624
home : /root
===============================================================================
--- PM2 list -----------------------------------------------
โโโโโโฌโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโฌโโโโโโโโโโโ
โ id โ name โ mode โ โบ โ status โ cpu โ memory โ
โโโโโโผโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโค
โ 0 โ app โ cluster โ 5 โ online โ 0% โ 35.1mb โ
โ 1 โ app โ cluster โ 5 โ launching โ 0% โ 0b โ
โ 2 โ app โ cluster โ 4 โ online โ 58.2% โ 60.9mb โ
โ 3 โ app โ cluster โ 4 โ online โ 0% โ 50.8mb โ
โ 4 โ app โ cluster โ 4 โ online โ 0% โ 50.7mb โ
โ 5 โ app โ cluster โ 4 โ online โ 0% โ 43.2mb โ
โ 6 โ app โ cluster โ 4 โ online โ 0% โ 39.8mb โ
โ 7 โ app โ cluster โ 4 โ launching โ 0% โ 0b โ
โโโโโโดโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโดโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโ
===============================================================================
--- Daemon logs --------------------------------------------
Same error using pm2-runtime start ecosystem.config.js:
Error: No build files found in /app/ecosystem.config.js/.nuxt/dist/server
any updates on this issue ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
And again FATAL No build files found in /docker-.../pm.config.js/.nuxt/dist/server
I have same issue @jsjain, Did you find any solution?
giving the cwd, fixed it for me
@jsjain cwd in ecosystem file ? can you give an example ?
yeah sure, cwd: '/user/src/app' assuming this is where your code is. and along with it script will still be the same script: ./node_modules/nuxt-start/bin/nuxt-start.js
thanks @jsjain, but finally I changed my script in ecosystem, because our app is working in workspace and I don't want to setup fixed path to cwd so it looks now:
script: './node_modules/nuxt/bin/nuxt.js',
args: `-c ${join(__dirname, 'packages/your-app/nuxt.config.js')}`,
additionally you have to change rootDir in nuxt.config
rootDir: __dirname,
Most helpful comment
Same error using
pm2-runtime start ecosystem.config.js: