Getting Error of missing module "express-handlebars" not found, but things is I am not using this dependency

This is an express server and I am building api’s for my e-commerce. the project is working fine locally and didn’t encounter errors, But while deploying it gives the error “cannot find module express-handlebars”. I am not using this module in any file and it’s not even in my package.json. While debugging I found the module I am using “nodemailer-express-handlebars” has peer dependencies of “express-handlebars”, I think while doing the npm install in render it’s not installing the “express-handlebars” that’s why it throwing an error, but in local doing “npm install” it installs the “express-handlebars” module. I having a hard time solving this issue, If anyone can help me in this would be appreciated.

As you can see in the picture I not using the “express-handlebars”, But the “nodemailer-express-handlebars” having it as peer dependencies.

Hi,

This might be related to the Node version being used. Newer versions of Node (and the bundled npm) resolved peer dependencies differently.

The deploy logs show the Node version being used and a link to the docs on how to change it, for example

==> Using Node version 14.17.0 (default)
==> Docs on specifying a Node version: https://render.com/docs/node-version

Maybe trying setting the Node version to the one you developed/tested on.

Alan

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.