• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Issue Cannot run NextJS website ( Error: Cannot find module '../server/require-hook' )

yelnya

New Pleskian
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:
Screenshot_33.png
Here is my node_modules/.bin/next file ( I changed const defaultCommand from "dev" to "start" )
Screenshot_35.png

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 had the same problem, have you found the solutions for this TT.TT I did follow the instruction but I still have the same error
 
I have the same problem when editing files (e.g. package.json) with the Plesk file manager. When I do not open the file manager or any file with it and modifying the files via the command line, everything works fine.

I think it is some kind of file permission problem, but I do not know yet what exactly the problem is...
 
Back
Top