- Server operating system version
- AlmaLinux 8
- Plesk version and microupdate number
- Plesk Obsidian Version 18.0.55 Update #2
I am unable to make NextJS ( "next": "13.1.1" / "next": "13.5.6" ) work with Plesk,
I have followed all the exact tutorial steps from: How to set up your NEXT.JS app on Plesk server
Here is my Node.js Dashboard Page:
Here is my node_modules/.bin/next file ( I changed const defaultCommand from "dev" to "start" )
Here is the result when I run "npm run build" ( Error: Cannot find module '../server/require-hook' ):
> [email protected] build
> next build
node:internal/modules/cjs/loader:1031
throw err;
^
Error: Cannot find module '../server/require-hook'
Require stack:
- /var/www/vhosts/chatty.asia/dashboard.chatty.asia/node_modules/.bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
at Function.Module._load (node:internal/modules/cjs/loader:873:27)
at Module.require (node:internal/modules/cjs/loader:1100:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/var/www/vhosts/chatty.asia/dashboard.chatty.asia/node_modules/.bin/next:6:1)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/var/www/vhosts/chatty.asia/dashboard.chatty.asia/node_modules/.bin/next'
]
}
I have another NextJS domain ( "next": "12.1.0" ) and it is working perfectly fine but not for my new NextJS project ( "next": "13.1.1" / "next": "13.5.6" )
This is my "package.json" file:
{
"name": "nextjs_plesk_test",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"eslint": "8.52.0",
"eslint-config-next": "13.5.6",
"next": "13.5.6",
"react": "18.2.0",
"react-dom": "18.2.0"
}
}
I have followed all the exact tutorial steps from: How to set up your NEXT.JS app on Plesk server
Here is my Node.js Dashboard Page:
Here is my node_modules/.bin/next file ( I changed const defaultCommand from "dev" to "start" )
Here is the result when I run "npm run build" ( Error: Cannot find module '../server/require-hook' ):
> [email protected] build
> next build
node:internal/modules/cjs/loader:1031
throw err;
^
Error: Cannot find module '../server/require-hook'
Require stack:
- /var/www/vhosts/chatty.asia/dashboard.chatty.asia/node_modules/.bin/next
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
at Function.Module._load (node:internal/modules/cjs/loader:873:27)
at Module.require (node:internal/modules/cjs/loader:1100:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object.<anonymous> (/var/www/vhosts/chatty.asia/dashboard.chatty.asia/node_modules/.bin/next:6:1)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/var/www/vhosts/chatty.asia/dashboard.chatty.asia/node_modules/.bin/next'
]
}
I have another NextJS domain ( "next": "12.1.0" ) and it is working perfectly fine but not for my new NextJS project ( "next": "13.1.1" / "next": "13.5.6" )
This is my "package.json" file:
{
"name": "nextjs_plesk_test",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"eslint": "8.52.0",
"eslint-config-next": "13.5.6",
"next": "13.5.6",
"react": "18.2.0",
"react-dom": "18.2.0"
}
}