-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
We use the "gatsby-plugin-sharp" and "gatsby-transformer-sharp" npm packages in our project. The issue is that, during the production build, when yarn installs modules, it sometimes throws errors while installing the sharp package. This issue occurs rarely. When the installation process fails, we encounter one of the following errors:
- Timeout error:
fatal error: glib-object.h: No such file or directory
This error started happening after upgrading Node.js from version 20 to version 22. These errors occur only during the production build when installing node modules (on Netlify in our case). I do not encounter this issue locally.
Reproduction Link
Steps to Reproduce
- Install NodeJS v22
- Add
gatsby-plugin-sharpandgatsby-transformer-sharpdependencies to your project - Remove
node_modulesfolder - Install node modules (An error should appear at this step.)
- This error occurs rarely, so it might be difficult to reproduce it.
Expected Result
Installation of npm packages should complete successfully as part of the production build.
Actual Result
The installation of npm packages sometimes fails during the production build, with the errors described in the description section.
Environment
System:
OS: macOS 15.7.4
CPU: (12) arm64 Apple M3 Pro
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.22.0 - ~/.nvm/versions/node/v22.22.0/bin/node
Yarn: 4.10.3 - ~/.nvm/versions/node/v22.22.0/bin/yarn
npm: 10.9.4 - ~/.nvm/versions/node/v22.22.0/bin/npm
Browsers:
Safari: 18.6Config Flags
No response