Has anyone faced Error read EINVAL when deploying NextJs to CPanel?
I'm trying to deploy NextJs application to CPanel, followed official documentation on creating a custom server, getting Error read EINVAL code in logs.
12 Replies
I have deployed mine without any errors though
Can you send link to the official doc you used
Didn't see such during my time
Advanced Features: Custom Server | Next.js
Start a Next.js app programmatically using a custom server.
I am lost
I think you miss interpreted the doc though
Are you deploying next js as an api endpoint?
Yes I'm using some api endpoint in my project if thats what youre asking
The thing is, I have trying deploying on two difference serves, the one withoud CloudLinux it runs fine through application manager, on the other one throught setup NodeJs app it gives me this error
I still don't understand
I haven't deployed a next js based api before
I'm still trying to figure out whats wrong, thank you anyway!
But i feel the proper way is run npm run build
Then push the .next app to your server
Then on your server use ngix
And do the configuration etc
Then install pm2 and configure youe npm run serve in the pm2 way
Or if you don't want pm2
Install tmux and byoyu
And run npm run serve
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Unfortunately I did not have a full access to the server and couldn't use ssh either, we moved to a different hosting and application runs perfectly now, thank you everyone for your feedback
where are you hosting?
and what type of hosting?
cpanel ?
Yes cpanel, the one that didn't work properly is a2hosting
Good
Search for terminal on your cpanel
If they is one then i think your problem could be solved