List direct dependencies
Read-only
What do risk levels mean?
- Read-only
- Inspects state without changing anything.
- Low risk
- Reversible with a routine follow-up command.
- Medium risk
- Changes state; undo path documented.
- Destructive
- Deletes or overwrites; confirmation required.
Lists packages installed at the project root without changing package metadata or installed modules.
nodenpmdependencies
Commands
Show direct production and development dependencies with resolved versions
npm ls --depth=0Verification
npm ls --depth=0Direct packages are listed, or only the project is shown when none are installed.
Undo
Not undoable
This recipe only reads the installed dependency tree and changes nothing.
Pitfalls
- npm marks missing, invalid, or extraneous packages and may exit nonzero when the tree has problems.