[X] 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
Running gatsby completely fails on Node.js 20 on my configuration.
isLocalGatsbySite function is silently crashing here:
TypeError [Error]: [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module
"/my-gatsby/package.json" needs an import assertion of type "json"
at load$1 (/my-gatsby/.pnp.loader.mjs:1458:17)
at nextLoad (node:internal/modules/esm/hooks:832:28)
at Hooks.load (node:internal/modules/esm/hooks:415:26)
at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20)
at exports.emitMessage (node:internal/per_context/messageport:23:28) {
code: 'ERR_IMPORT_ASSERTION_TYPE_MISSING'
}
causing the function to return false, causing the error in question.
Reproduction Link
See steps to reproduce
Steps to Reproduce
Use Yarn v2/v3/v4 in PnP mode and run:
yarn dlx gatsby new my-gatsby
cd my-gatsby
yarn build
Expected Result
Gatsby CLI commands to execute.
Actual Result
Either the current working directory does not contain a valid package.json or 'gatsby' is not specified as a
dependency
Preliminary Checks
Description
Running gatsby completely fails on Node.js 20 on my configuration.
isLocalGatsbySite
function is silently crashing here:https://github.com/gatsbyjs/gatsby/blob/47ec2ac04235d9ae45614a4596a250a44398e9cf/packages/gatsby-cli/src/create-cli.ts#L449-L451
with the following error:
causing the function to return
false
, causing the error in question.Reproduction Link
See steps to reproduce
Steps to Reproduce
Use Yarn v2/v3/v4 in PnP mode and run:
Expected Result
Gatsby CLI commands to execute.
Actual Result
Environment
Config Flags
No response