Hosting Plesk Windows, port redirect error

System Information
  • Strapi Version: 4
  • Operating System: Windows 2022 Datacenter + Plesk Obsidian
  • Database: MariaDB 10.6.9
  • Node Version: 16.16
  • NPM Version: 8.19.2
  • Yarn Version: N/A

Hi Community :slight_smile:
I want to set up Strapi (v4) on a Plesk (Windows) / nodeJS (16.16) / MySQL (MariaDb 10.6.9) environment but I get the error: options.port should be >= 0 and < 65536. Received NaN.

I did the installation like this :

$ npx create-strapi-app plesk-strapi --no-run
$ # custom Install
$ # wait for installation process to finish
$ cd strapi-demo.xyz.com
$ npm run build

I configure the boot of the application at the root of the project ‘/app.js’

const strapi = require('@strapi/strapi'); //require('strapi');
strapi().start();

And file ‘config/server.js’ :

module.exports = ({ env }) => ({
  host: env('HOST', process.env.HOST || '127.0.0.1'),
  port: env.int('PORT', parseInt(process.env.PORT) || 80),
  app: {
    keys: env.array('APP_KEYS'),
  },
});

And file ‘/.env’ :

HOST=127.0.0.1
PORT=80

APP_KEYS= mySecretKey1, mySecretKey2, mySecretKey3, mySecretKey4
API_TOKEN_SALT= mySecretSaltKey
ADMIN_JWT_SECRET=mySecretKey
JWT_SECRET=mySecretKey

# `sqlite` or `mysql`
DATABASE_CONNECTION_NAME=mysql

DATABASE_HOST=localhost
DATABASE_PORT=3306
DATABASE_NAME=myDbName
DATABASE_USERNAME=MyDbUsername
DATABASE_PASSWORD=MyDbPassword

Plesk nodeJS config :

plesk-nodejs-config

return Error :

[2022-10-20 09:33:55.897] [34mdebug[39m: ⛔️ Server wasn't able to start properly.

[2022-10-20 09:33:55.904] [31merror[39m: options.port should be >= 0 and < 65536. Received NaN.
RangeError [ERR_SOCKET_BAD_PORT]: options.port should be >= 0 and < 65536. Received NaN.
    at new NodeError (node:internal/errors:372:5)
    at validatePort (node:internal/validators:217:11)
    at Server.listen (node:net:1500:5)
    at Object.listen (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\services\server\index.js:122:25)
    at E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\Strapi.js:302:21
    at new Promise (<anonymous>)
    at Strapi.listen (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\Strapi.js:281:12)
    at Strapi.start (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\Strapi.js:215:18)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)


thank’s for your help

an idea maybe ?

(node:9136) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Application has thrown an uncaught exception and is terminated:
TypeError: process.send is not a function
    at Strapi.stop (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\Strapi.js:321:15)
    at Strapi.stopWithError (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\Strapi.js:314:17)
    at Strapi.start (E:\plesk\vhost\xyz.com\strapi-demo.xyz.com\node_modules\@strapi\strapi\lib\Strapi.js:219:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)