# npm ERR! code ELSPROBLEMS — invalid / extraneous / missing packages in npm ls

**Code:** `ELSPROBLEMS` · **Category:** npm · **Seen on:** npm

npm ls found the installed tree doesn’t match package.json and the lockfile.

## Meaning

“invalid” means an installed version doesn’t satisfy the declared range, “extraneous” means installed but not declared, “missing” means declared but not installed. Often after manual edits, interrupted installs or mixing package managers.

## Common causes

- Interrupted or partial install
- Manual edits to node_modules or package.json
- Mixing npm with yarn/pnpm in one project
- Peer dependency ranges not satisfied

## Quick fix

1. Reinstall cleanly: rm -rf node_modules && npm ci
2. Remove extraneous packages: npm prune
3. Fix ranges flagged as invalid

## Detailed fix by platform

### npm

1. `npm ls --all 2>&1 | grep -E "invalid|missing|extraneous"`

## How to diagnose

1. **Problems** — Which packages are listed?
2. **Lockfile** — In sync with package.json?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/npm/elsproblems-invalid-extraneous)
