@netlify/plugin-gatsby causing production build to fail - 'clipboardy' 4.0.0 requiring Node v18 on my Node v14 app (sharing my fix)

If anyone else is suddenly running into this issue when your Gatsby build is failing to initialize:

11:34:56 PM: error clipboardy@4.0.0: The engine “node” is incompatible with this module. Expected version “>=18”. Got “14.21.3”
11:34:56 PM: error Found incompatible module.
11:34:56 PM: info Visit yarn install | Yarn for documentation about this command.
11:34:56 PM: Error during Yarn install
11:34:56 PM: Failing build: Failed to install dependencies

The @netlify/plugin-gatsby package requires “ipx” 1.4.6, which has a dependency on “listhen” whose version is set to ^1.5.5. This “listhen” package was recently updated to 1.5.6, which updates a dependency on ‘clipboardy’ to 4.0.0 from 3.0.0 – this update requires NodeJS v18.

The new node version requirement broke my production builds as I am on Node v14.

I was able to define an override to apply to Netlify’s yarn build process with an update to package.json to lock “listhen” to 1.5.5. I tried to get it to be more specific (e.g. “@netlify/plugin-gatsby/@netlify/ipx/listhen” but it only seemed to work properly by pinning it globally like this:

“resolutions”: {
“listhen”: “1.5.5”

Clipboardy is present as a dependency in several other packages at earlier versions than even 3.0.0, so I tried to narrow down my update specifically to “listthen.”

Hope this helps anyone who might be running into this deploy issue!