# TypeScript: error TS2554: Expected 2 arguments, but got 1.

**Code:** `TS2554: Expected N arguments, but got M` · **Category:** TypeScript · **Seen on:** TypeScript

A call passes too few or too many arguments.

## Meaning

Match the signature: add the missing argument, make parameters optional (`b?: number`) or give defaults, or fix the call after a library upgrade changed the signature. For callbacks passed to `map`/`forEach` extra args are allowed; direct calls are strict.

## Common causes

- Missing required argument
- Extra argument
- Signature changed in a library update
- Optional parameter not marked
- Spread/tuple mismatches

## Quick fix

1. Pass the missing arguments or mark parameters optional
2. Check the library's current signature (hover/docs)
3. Use default parameter values

## Detailed fix by platform

### TypeScript

1. `function greet(name: string, greeting = "Hello") { }`

## How to diagnose

1. **Params** — Required count?
2. **Call** — Passed?
3. **Lib** — Upgrade changed?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/typescript/ts2554-expected-n-arguments-but-got-m)
