vuejs/vue-cli · error · Error

Make sure you define a value for the option ${options.set}

Error message

Make sure you define a value for the option ${options.set}

What it means

Thrown by the `vue config --set` command when the --set flag is provided but no value argument is supplied on the command line. The config command requires both a key (via --set) and a value; omitting the value is treated as an error since writing an undefined value to the config file is not meaningful.

Source

Thrown at packages/@vue/cli/lib/config.js:50

  if (options.delete) {
    unset(config, options.delete)
    await fs.writeFile(file, JSON.stringify(config, null, 2), 'utf-8')
    if (options.json) {
      console.log(JSON.stringify({
        deleted: options.delete
      }))
    } else {
      console.log(`You have removed the option: ${options.delete}`)
    }
  }

  if (options.edit) {
    launch(file)
  }

  if (options.set && !value) {
    throw new Error(`Make sure you define a value for the option ${options.set}`)
  }

  if (options.set && value) {
    set(config, options.set, value)

    if (value.match('[0-9]')) {
      set(config, options.set, parseInt(value))
    }

    if (value === 'true') {
      set(config, options.set, true)
    }

    if (value === 'false') {
      set(config, options.set, false)
    }

    await fs.writeFile(file, JSON.stringify(config, null, 2), 'utf-8')

View on GitHub (pinned to 7eb93c169c)

Solutions

  1. Provide a value after the --set key: vue config --set someKey someValue.
  2. If you meant to inspect rather than set, use `vue config --get someKey` instead.
  3. To remove a key, use `vue config --delete someKey`.

Example fix

# before
$ vue config --set presets
Error: Make sure you define a value for the option presets
# after
$ vue config --set presets eslint
Defensive patterns

Strategy: validation

Validate before calling

// Before calling the config command programmatically:
if (options.set && (value === undefined || value === null || value === '')) {
  console.error(`A value must be provided for --set ${options.set}`);
  process.exit(1);
}

Prevention

When it happens

Trigger: Running `vue config --set someKey` without providing a value argument after it.

Common situations: User forgets the value argument, or a script/macro incorrectly constructs the command. Misunderstanding the CLI syntax where --set expects two operands.

Related errors


AI-assisted analysis of vuejs/vue-cli@7eb93c169c (2026-08-13). Data as JSON: /api/errors/e341ad3ada14198a. Report an issue: GitHub.