On install one gets warning " > nodemailer-express-handlebars@6.1.2" has unmet peer dependency "express-handlebars@>= 6.0.0".
This results in an error on run time.
$ node index.js
Error: Cannot find module 'express-handlebars'
Require stack:
- /home/node/app/node_modules/nodemailer-express-handlebars/lib/generator.js
- /home/node/app/node_modules/nodemailer-express-handlebars/lib/index.js
- /home/node/app/node_modules/nodemailer-express-handlebars/index.js
- /home/node/app/src/mailer.js
- /home/node/app/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1219:15)
at Module._load (node:internal/modules/cjs/loader:1045:27)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
at Module.require (node:internal/modules/cjs/loader:1304:12)
at require (node:internal/modules/helpers:123:16)
at Object.<anonymous> (/home/node/app/node_modules/nodemailer-express-handlebars/lib/generator.js:4:20)
at Module._compile (node:internal/modules/cjs/loader:1467:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
at Module.load (node:internal/modules/cjs/loader:1282:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/node/app/node_modules/nodemailer-express-handlebars/lib/generator.js',
'/home/node/app/node_modules/nodemailer-express-handlebars/lib/index.js',
'/home/node/app/node_modules/nodemailer-express-handlebars/index.js',
'/home/node/app/src/mailer.js',
'/home/node/app/index.js'
]
}
The express-handlebars module is loaded by the nodemailer-express-handlebars package under nodemailer-express-handlebars/lib/generator.js:4:20
I checked the npm page and was confused about 0 Dependencies being listed. express-handlebars is listed only as a development dependency. There seems to be an error in the package dependency listing.
The "express-handlebars" package should be listed as a dependency, not as a development dependency since it is required to load the package at all.
How to reproduce
This error can be reproduced, if one installs via "yarn install --production" or "npm install --omit=dev". These options are used to reduce size in production installs like docker containers.
On install one gets
warning " > nodemailer-express-handlebars@6.1.2" has unmet peer dependency "express-handlebars@>= 6.0.0".
This results in an error on run time.
The express-handlebars module is loaded by the nodemailer-express-handlebars package under
nodemailer-express-handlebars/lib/generator.js:4:20
I checked the npm page and was confused about 0 Dependencies being listed. express-handlebars is listed only as a development dependency. There seems to be an error in the package dependency listing. The "express-handlebars" package should be listed as a dependency, not as a development dependency since it is required to load the package at all.
How to reproduce
This error can be reproduced, if one installs via "yarn install --production" or "npm install --omit=dev". These options are used to reduce size in production installs like docker containers.