email-templates: Error: Cannot find module 'underscore'

Seems that upon installing email-templates and pug, by importing email-templates I get the following error:

image

The code I’m using is quite simple:

const Email = require("email-templates");

const email = new Email({
    message: { from: fromAddr },
    send: true,
    transport: __transport
});
email
    .send({
        template,
        message: { to: toAddr },
        locals: Object.assign({
            emailID
        }, properties)
    });

__transport is a Nodemailer transport instance:

__transport = nodemailer.createTransport({
    SES: getSES()
});

I’m running this on Node 10 in a docker container. Everything installs fine, but I get that error when I try to run that code. I’m using Nodemailer v4.6.8 and email-templates v5.0.0.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Reinstall node_modules and/or reinstall node. This does not seem to be related to this package since this package does not use underscore directly.

Well thanks for the overwhelming support. I’ll find another library.

Ok, I can try that, but npm install is run properly each time.

Why close the issue so soon?