quasarframework/quasar · error

Wrong number of parameters (${argv._.length}).

Error message

Wrong number of parameters (${argv._.length}).

What it means

The 'quasar mode' CLI accepts either no parameters (list modes) or exactly two (an action — add/remove — and a mode name). Any other count prints this warning, shows help, and exits with code 1.

Source

Thrown at app-vite/lib/cmd/mode.js:65

    --app-id       The application id to scaffold with
                     (default: org.cordova.quasar.app /
                      org.capacitor.quasar.app)

    ONLY when adding Capacitor mode:
    --app-name     The application display name to scaffold with
                     (default: package.json > productName or name)
  `)
}

if (argv.help) {
  showHelp()
  argv.__warn?.()
  process.exit(0)
}

if (argv._.length !== 0 && argv._.length !== 2) {
  console.log()
  warn(`Wrong number of parameters (${argv._.length}).`)
  showHelp()
  process.exit(1)
}

import { green, gray } from 'kolorist'

import { getCtx } from '../utils/get-ctx.js'
import { generateTypes } from '../types-generator.js'
import { isModeInstalled, ssrWebservers } from '../modes/modes-utils.js'

async function run() {
  const [action, mode] = argv._
  const ctx = getCtx({ mode: 'spa' })

  if (!['add', 'remove'].includes(action)) {
    console.log()
    warn(`Unknown action specified (${action}).`)
    showHelp()

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Supply exactly two parameters: 'quasar mode <add|remove> <mode>'.
  2. Run 'quasar mode' with no arguments to list available/installed modes.
  3. Run 'quasar mode --help' for usage details.
  4. Add modes one at a time in separate commands.

Example fix

// before
quasar mode ssr
// after
quasar mode add ssr
Defensive patterns

Strategy: validation

Validate before calling

const rest = args.slice(1); // after 'mode'
if (rest.length !== 0 && rest.length !== 2) {
  throw new Error('quasar mode takes 0 or 2 params: [<add|remove> <mode>]');
}

Prevention

When it happens

Trigger: Running 'quasar mode ssr' (1 param, missing the action) or 'quasar mode add ssr pwa' (3+ params).

Common situations: Skipping the 'add' keyword, trying to set multiple modes in one command, or scripts built for older CLI versions.

Related errors


AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30). Data as JSON: /api/errors/868d8e32232f017f. Report an issue: GitHub.