Nodemailer Error Can't Fix

旧巷老猫 提交于 2019-12-01 02:16:11

Node.js version 6+ is required. Check your Node version with the following command:

node --version

If you are not at least 6+ then you must upgrade.

You may receive another error message instructing you to login to your account. In that case, go to your email inbox and you will see a message from Google with a link to a page for setting up less secure app permissions.

Simply Add this in your package.json file.

"engines": {
    "node": "6.9.4"    // You can use any version
  }

This will automatically download the node version you provide. By this way you don't need to upgrade your NodeJS every time in server.

Nodemailer is compatible with Node version 6 or above (as per https://nodemailer.com/about/#requirements)

So follow these steps to upgrade node:

1* sudo npm cache clean -f

2* sudo npm install -g n

3* sudo n stable

4* sudo ln -sf /usr/local/n/versions/node/5.4.1/bin/node /usr/bin/node (the bold text/version should be the one installed in during above step.)

ie if 8.1.1 is installed then do sudo ln -sf /usr/local/n/versions/node/8.1.1/bin/node /usr/bin/node

node –v (Should show updated version now)

Answered here as well Nodemailer error when required

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!