Fix Node.js Error: version \`GLIBC_2.28' not found

Issue

During a Node.js build, the following error occurs:

node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)

Resolution

This error occurs when the selected Node.js version does not support the underlying operating system's libc6 package. This error is known to occur with Node.js versions 18 or greater when running on the heroku-18 stack.

To solve this issue, there are two options.

  1. Suggested: Update the app to a stack that is compatible with the Node.js version (heroku-20 or newer):
heroku stack:set heroku-22
  1. Less Optimal: Pin to a Node.js version compatible with the current stack in your package.json (16.x or older):
{
  "engines": {
    "node": "16.x"
  }
}

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support