Search code examples
node.jsherokudiscorddiscord.js

Heroku Node.js version 16


I'm currently trying to run a Discord bot using discord.js version 13, but that requires Node.js version 16. Heroku only uses Node.js 14.

How can I update?


Solution

  • Heroku only uses Node.js 14

    Where did you get that idea?

    At the time of writing, Heroku supports Node.js versions 12.x, 14.x, and 16.x. You can specify the version you want via the engines key in your package.json, like in this slightly modified example from the docs:

    {
      "name": "myapp",
      "description": "a really cool app",
      "version": "1.0.0",
      "engines": {
        "node": "16.x"
      }
    }
    

    Make sure you update your local version of Node.js, too.

    I'm not sure what operating system you are using, but I usually use nvm to manager multiple versions of Node.js on one machine.