Hi
We are trying to deploy a next.js app into our plesk. But are struggling to make it work.
The problem we are facing is that Plesk's Node.js extension expects an entry point for the app (like app.js) but next.js doesn't work that way.
The expected workflow as explained here (Learn - Deploying a Next.js App | Next.js) is to run the app using npm via the command line using "npm start" after you have built the app and next.js handles the rest internally.
We have tried issuing the commands from the plesks node panel run script command and while we can build the app we get the following error when we try to run the "start --scripts-prepend-node-path" command:
> XXXX@1.0.0 start /var/www/vhosts/XXXX.com/httpdocs
> next start -p 80
Error: listen EACCES: permission denied 0.0.0.0:80
at Server.setupListenHandle [as _listen2] (net.js:1209:19)
at listenInCluster (net.js:1274:12)
at Server.listen (net.js:1362:7)
at /var/www/vhosts/XXXX.com/httpdocs/node_modules/next/dist/server/lib/start-server.js:2:62
at new Promise (<anonymous>)
at start (/var/www/vhosts/XXXX.com/httpdocs/node_modules/next/dist/server/lib/start-server.js:1:407)
at nextStart (/var/www/vhosts/XXXX.com/httpdocs/node_modules/next/dist/cli/next-start.js:22:125)
at /var/www/vhosts/XXXX.com/httpdocs/node_modules/next/dist/bin/next:29:346 {
code: 'EACCES',
errno: 'EACCES',
syscall: 'listen',
address: '0.0.0.0',
port: 80
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! XXXX@1.0.0 start: `next start -p 80`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fersoler@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/www/vhosts/XXXX.com/.npm/_logs/2019-11-18T16_37_59_408Z-debug.log
Can anyone shed some light on how to go about deploying a next.js app on plesk.
Thanks!
We are trying to deploy a next.js app into our plesk. But are struggling to make it work.
The problem we are facing is that Plesk's Node.js extension expects an entry point for the app (like app.js) but next.js doesn't work that way.
The expected workflow as explained here (Learn - Deploying a Next.js App | Next.js) is to run the app using npm via the command line using "npm start" after you have built the app and next.js handles the rest internally.
We have tried issuing the commands from the plesks node panel run script command and while we can build the app we get the following error when we try to run the "start --scripts-prepend-node-path" command:
> XXXX@1.0.0 start /var/www/vhosts/XXXX.com/httpdocs
> next start -p 80
Error: listen EACCES: permission denied 0.0.0.0:80
at Server.setupListenHandle [as _listen2] (net.js:1209:19)
at listenInCluster (net.js:1274:12)
at Server.listen (net.js:1362:7)
at /var/www/vhosts/XXXX.com/httpdocs/node_modules/next/dist/server/lib/start-server.js:2:62
at new Promise (<anonymous>)
at start (/var/www/vhosts/XXXX.com/httpdocs/node_modules/next/dist/server/lib/start-server.js:1:407)
at nextStart (/var/www/vhosts/XXXX.com/httpdocs/node_modules/next/dist/cli/next-start.js:22:125)
at /var/www/vhosts/XXXX.com/httpdocs/node_modules/next/dist/bin/next:29:346 {
code: 'EACCES',
errno: 'EACCES',
syscall: 'listen',
address: '0.0.0.0',
port: 80
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! XXXX@1.0.0 start: `next start -p 80`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fersoler@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/www/vhosts/XXXX.com/.npm/_logs/2019-11-18T16_37_59_408Z-debug.log
Can anyone shed some light on how to go about deploying a next.js app on plesk.
Thanks!