inspect
npm view (info)
Fetches package metadata straight from the registry — versions, maintainers, dist-tags, dependencies, and more. Aliases: `info`, `show`, `v`.
npm view <pkg>[@<version>] [<field>[.<subfield>...]] Common flags
| Flag | Purpose |
|---|---|
| --json | Emit the raw metadata as JSON |
| --registry <url> | Query a specific registry |
Examples
npm view react versions List every published version of react
npm view react@latest Show metadata for the latest release
npm view react dist-tags See which versions are tagged latest/next/etc.
npm view lodash description homepage Print two specific fields
Gotcha
Without a version specifier `npm view` targets the `latest` dist-tag, which may not be the newest published version if a maintainer holds it back. Use `npm view
Related commands
npm outdated
Compares installed versions against the registry and reports which packages have a newer version available in current/wanted/latest columns. `wanted` respects your semver range, `latest` is the newest published.
npm list
Prints the installed dependency tree of the current project (or globally). Aliases: `ls`, `la`, `ll`.
npm why (explain)
Prints the dependency chain(s) that caused a specific package (or version) to be installed. Alias: `why`; invaluable for tracking down duplicate copies or unexpected transitive deps.