• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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