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' isGatsbyNodeLifecycleSupported() when require('gatsby/apis.json') fails. This function checks whether a given Node API name (e.g., 'createSchemaCustomization') is supported by the installed Gatsby version. Same root cause as hasFeature but targets the node lifecycle APIs list.

Source

Thrown at packages/gatsby-plugin-utils/src/node-api-is-supported.ts:6

export function isGatsbyNodeLifecycleSupported(apiName: string): boolean {
  let availableAPIs
  try {
    availableAPIs = require(`gatsby/apis.json`)
  } catch (e) {
    throw new Error(
      `Couldn't check available APIs. Make sure you are on gatsby version >=2.13.41`
    )
  }

  return !!availableAPIs?.node?.[apiName]
}

View on GitHub (pinned to 8b06340921)

Solutions

  1. Upgrade Gatsby to >= 2.13.41 (latest stable recommended).
  2. Verify with npm ls gatsby that only one version is installed.
  3. Reinstall node_modules if the gatsby package appears corrupted.
  4. Pin the plugin calling this function to a version matching your Gatsby major.

Example fix

# before
"gatsby": "^2.10.0"
# after
"gatsby": "^4.0.0"
Defensive patterns

Strategy: validation

Validate before calling

// Guard isGatsbyNodeLifecycleSupported call
const gatsbyVersion = require('gatsby/package.json').version
const [major, minor] = gatsbyVersion.split('.').map(Number)
if (major < 2 || (major === 2 && minor < 13)) {
  return false // API not supported on this version
}
return isGatsbyNodeLifecycleSupported(apiName)

Try / catch

try {
  return isGatsbyNodeLifecycleSupported(apiName)
} catch {
  return false // gracefully degrade on old Gatsby
}

Prevention

When it happens

Trigger: require('gatsby/apis.json') throws when Gatsby < 2.13.41 or the gatsby package is missing/corrupted; the catch rethrows the version hint.

Common situations: A plugin calls isGatsbyNodeLifecycleSupported() to conditionally register a newer lifecycle hook, but the project runs an older Gatsby that lacks apis.json.

Related errors


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/62101c9c9ba1f65a. Report an issue: GitHub.