gatsbyjs/gatsby · error

Please pass your desired config key and value. Currently you

Error message

Please pass your desired config key and value. Currently you can only set your package manager using `pm`.

What it means

CLI usage warning from `gatsby config set`: the command was invoked with a key other than `pm`/`package-manager` (or with a missing value), and package manager is currently the only configurable key. It is a guard against unsupported config keys, not an error in existing configuration.

Source

Thrown at packages/gatsby-cli/src/create-cli.ts:603

          setPackageManager(`npm`)
        }

        if (cmd === `set`) {
          if (key === `pm` || key === `package-manager`) {
            if (value && value !== `yarn` && value !== `npm`) {
              report.panic(`Package manager must be yarn or npm.`)
            }

            if (value) {
              // @ts-ignore
              setPackageManager(value)

              return
            } else {
              setPackageManager(`npm`)
            }
          } else {
            reporter.warn(
              `Please pass your desired config key and value. Currently you can only set your package manager using \`pm\`.`
            )
          }
          return
        }

        console.log(`
        Package Manager: ${getPackageManager()}
        `)
      }),
    })
    .wrap(cli.terminalWidth())
    .demandCommand(1, `Pass --help to see all available commands and options.`)
    .strict()
    .recommendCommands()
    .parse(argv.slice(2))
}

View on GitHub (pinned to e85d62f177)

Solutions

  1. Use `gatsby config set pm yarn` or `gatsby config set pm npm`
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/gatsby-cli/src/create-cli.ts:603 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gatsbyjs/gatsby@e85d62f177 (2026-08-26). Data as JSON: /api/errors/0534b8bd26ae74d2. Report an issue: GitHub.