Heroku issue with NodeMailer

前端 未结 2 1152
-上瘾入骨i
-上瘾入骨i 2021-02-04 19:23

I am having an issue with Nodemailer on Heroku and I would really appreciate your help.

A previous version of my application used to work on Heroku with no problem and w

2条回答
  •  梦谈多话
    2021-02-04 19:57

    I'm working with meteor on an ubuntu install and I was getting similar errors after upgrading to Node.js v12.0 and installing Meteor's accounts-password module.

    Turned out, since Meteor has not yet begun development on compatibility with Node.js v12.0, the new binaries installed with Node on my server were not compatible with the binaries bundled with my deployment so I was getting similar errors. In this case, the problem was not with Nodemailer but with simplesmtp.

    As suggested here, the solution was to remove the bundled version and use npm to install a server-local version.

    So in my deployment script, I added the following lines after I built the bundle.

    cd bundle/programs/server/
    sudo rm -R ./npm/npm-bcrypt/node_modules/bcrypt
    sudo npm install bcrypt
    sudo rm -R ./npm/email/node_modules/simplesmtp
    sudo npm install simplesmtp
    

    This is easier than modifying the source, especially if you have a scripted deployment.

提交回复
热议问题