Stapi v5 deploy on hosting with cpanel

I’m currently deploying my Strapi application on a hosting service, and I’m encountering an issue. When I run the command node server.js in the terminal of cPanel or the hosting environment, I receive the following error:
"error: @strapi/email/package.json couldn’t be resolved
Error: @strapi/email/package.json couldn’t be resolved
at toDetailedDeclaration (/home/eerzlgpd/nodevenv/strapi/stampa_api/20/lib/node_modules/@strapi/core/dist/loaders/plugins/get-enabled-plugins.js:65:17)

"
In my plugins.js file, I have already configured my email settings as follows:
module.exports = ({ env }) => ({
email: {
config: {
provider: ‘nodemailer’,
providerOptions: {
host: env(‘SMTP_HOST’, ‘smtp.gmail.com’),
port: env(‘SMTP_PORT’, 587),
auth: {
user: env(‘SMTP_USERNAME’),
pass: env(‘SMTP_PASSWORD’),
},
secure: true,
// … any custom nodemailer options
},
settings: {
defaultFrom: ‘jddj1897@gmail.com’,
defaultReplyTo: ‘jddj1897@gmail.com’,
},
},
},
// …
});
I’m not sure what else to do, as this seems to be the only issue. Any help would be greatly appreciated!

Thank you!

This topic has been created from a Discord post (1290202025199669269) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Stapi v5 deploy on hosting with cpanel (email error deployment)

There was a problem with RC versions of email, the latest version was wrongfully tagged in npm. Upgrade to latest stable, remove your lock file and npm i again