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.
-
Suggested: Update the app to a stack that is compatible with the Node.js version (
heroku-20
or newer):
heroku stack:set heroku-22
-
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"
}
}