gatsbyjs/gatsby · error · Error
Couldn't check available APIs. Make sure you are on gatsby v
Error message
Couldn't check available APIs. Make sure you are on gatsby version >=2.13.41
What it means
Thrown by gatsby-plugin-utils' hasFeature() when require('gatsby/apis.json') fails, meaning the installed Gatsby version is too old to ship the apis.json manifest (introduced in Gatsby 2.13.41). The function checks whether a named feature flag exists in the Gatsby runtime's feature list.
Source
Thrown at packages/gatsby-plugin-utils/src/has-feature.ts:12
import type { AvailableFeatures } from "gatsby"
/**
* Check the readme for a list of available features.
*/
export function hasFeature(name: AvailableFeatures): boolean {
try {
const availableAPIs = require(`gatsby/apis.json`)
return !!availableAPIs?.features?.includes(name)
} catch (e) {
throw new Error(
`Couldn't check available APIs. Make sure you are on gatsby version >=2.13.41`
)
}
}
View on GitHub (pinned to 8b06340921)
Solutions
- Upgrade Gatsby to at least version 2.13.41 (preferably the latest 2.x or 4.x/5.x line).
- Run npm ls gatsby to confirm the installed version and check for version conflicts in a monorepo.
- Delete node_modules and reinstall to fix a corrupted gatsby package.
- If intentionally on an old Gatsby, update the plugin that calls hasFeature() to a version compatible with your Gatsby.
Example fix
# before "gatsby": "^2.12.0" # after "gatsby": "^2.13.41"
Defensive patterns
Strategy: validation
Validate before calling
// Check Gatsby version before calling hasFeature
const gatsbyPkg = require('gatsby/package.json')
const [major, minor, patch] = gatsbyPkg.version.split('.').map(Number)
const isSupported = major > 2 || (major === 2 && (minor > 13 || (minor === 13 && patch >= 41)))
if (!isSupported) {
throw new Error('Gatsby >= 2.13.41 required')
} Try / catch
try {
const apis = require('gatsby/apis.json')
} catch (e) {
// upgrade gatsby before calling hasFeature
} Prevention
- Pin Gatsby to a version >= 2.13.41 in package.json.
- Run npm ls gatsby to detect version conflicts in monorepos.
- Add an engines check in package.json for gatsby compatibility.
When it happens
Trigger: require('gatsby/apis.json') throws if Gatsby is older than 2.13.41 or if the gatsby package is corrupted/missing. The catch rethrows this version-mismatch message.
Common situations: A plugin calls hasFeature() but the project pins Gatsby to a pre-2.13.41 version, or the gatsby node_modules is partially installed/corrupted.
Related errors
- Couldn't check available APIs. Make sure you are on gatsby v
- 'babel-plugin-styled-components' is not installed which is n
- Could not find a suitable version of gatsby-cli. Please repo
- ${REPORTER_PREFIX} Error in default page filter
- ${REPORTER_PREFIX} Error in custom page filter. If you've cu
AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13).
Data as JSON: /api/errors/dd6b6600e65a6b56.
Report an issue: GitHub.