I’m trying to deploy a site to a Plesk server and unlike with previous Next JS versions where you had to edit /node_modules/.bin/next
file and add start
to const defaultCommand
.
(you can check reference here) https://medium.com/@keithchasen/how-to-set-up-your-next-js-app-on-plesk-server-7d8d247a2db2
I’m wondering if anyone of you know what would the hack for latest version of Next
Thanks in advance, NumaX
I tried this https://talk.plesk.com/threads/nextjs-works-on-plesk.354281/
2
Answers
The problem with the new next 14.2 release is that the next file from .bin has been rewritten again. Sadly the old method wont work with this.
I found a solution for Nextjs 14.2.5. Open and Edit the File in
/node_modules/.bin/next
via the File Manager. In lines 81-83, there should be the code:Set
isDefault
tofalse
Then in In line 105, there should be the following code:
Add an additional object argument with
isDefault: true
Save and close the file, then go to nodejs. Run
npm install
andnpm build
and it should be working now.IMPORTANT NOTE: When you have new updates to your project and would like to re-deploy your next app, first pull your project from your repository, then navigate to Node.js dev tool and restart it using the
Restart App
button, and finally runnpm install
andnpm build
.I hope Plesk would find a way to integrate Nextjs to its platform. At the moment it takes a lot of manual steps just to get it to work.