-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuxt SSR deployment on docker with pm2 has error. #8704
Comments
Please give more informations, like what is your |
ecosystem.config.yaml apps:
- name: App
exec_mode: cluster
instances: max
script: ./node_modules/nuxt/bin/nuxt.js
args: start |
Could you check https://nuxtjs.org/docs/2.x/deployment/deployment-pm2 ? |
@Atinux Everything is ok. but when i run |
From what I understand, the path giving to start Nuxt is wrong, try to set in the options: |
@Atinux Is there everything is correct. if run |
Sorry I meant It seems that the rootDir detected is not correct. Try to set in your export default {
rootDir: __dirname
} |
@Atinux It did not help. seam error. |
@farshidrezaei You seem to be using |
yes. everything is correct. thanks a lot. |
I am experiencing the same problem. node: v14.16.0 Works fine: Doesn't work: Error output:
As you can see from above the path is incorrect: Incorrect path: Intended path: My /var/www/ui/ecosystem.config.js file:
Multiple people are having this issue including myself: |
Shall we re-open @danielroe ? |
Any updates? Im getting the same error trying to run a Nuxt app on Docker container with pm2-runtime. |
Don't use pm2 in docker. just run |
I have the same issue, but without pm2. Just build Nuxt (2.15.4) as usual I'm using MacBook m1 and docker with --platform linux/amd64 if it can be useful. When I build without docker files |
I'm sorry, I figured out what happened in my case. For a docker build from With a My bad. The only weird thing is that with |
try first
https://www.python2.net/questions-1253548.htm It`s works for me |
I need to run nuxt app inside docker container and it should start using |
ecosystem.json or ecosystem. yml
ecosystem.config.js
nuxt.config.js
|
is no resolved,if use ecosystem.config.js,pm2-runtime start ecosystem.config.js is ok,but if use shell,pm2-runtime start './node_modules/nuxt/bin/nuxt.js' --name aaaa -i 1 -- start -c /Users/huangshuisheng/Desktop/hss/galaxy-s10/nuxt-blog-client/nuxt.config.js, is no work |
see: Unitech/pm2#4576 |
Although I don't know why, before executing pm2-runtime, run pm2 list or pm2 update first, and pm2-runtime will work normally without error:'xxxxxx/.nuxt/dist/server.', which is amazing |
Although I don't know why, before executing pm2-runtime, run pm2 list or pm2 update first, and pm2-runtime will work normally without error:'xxxxxx/.nuxt/dist/server.', which is amazing |
Could anyone provide the full ecosystem file + script that you are using to start the app using pm2? I am facing the same issue. I only see a few hacks without explaining the full solution. |
my wechat:shuisheng9905,I may be able to help you remotely,or,Provide your github repo,i can pullrequest |
@galaxy-s10, I've realized that doesn't make any sense to use pm2 inside a docker container and we switched to the default "npm run start" way. Doing a pm2 update && pm2-runtime xxxx worked fine. A few links related to docker vs pm2 and why you shouldnt use both of them: |
OK Thank you, but I think even if you don't use pm2 in the docker, you should also use npm run build&&npm run start, because the memory occupied by npm run dev is much larger than the npm run start executed after the build |
Oh, sorry. I used npm run start, I've just put the wrong command there. |
Versions
I did run
nuxt build
command then,when i run
pm2-runtime start ecosystem.yml
on docker, i get this error:how i can solve that?
The text was updated successfully, but these errors were encountered: