npm / npm/cli

[BUG] install/etc with --dry-run outputs misleading info (since it didn't actually do stuff)

Open
#1,999 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug cmd:update Priority 2 Release 7.x
Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

Current Behavior:

Installing (or other commands that call Arborist.reify(), like prune, dedupe, update, audit fix, etc.) using --dry-run produces output like this:

added 2 packages, removed 4 packages, and changed 2 packages in 12s

45 packages are looking for funding
  run `npm fund` for details

However, since the package tree was not actually reified, this output is misleading and not useful.

Expected Behavior:

Output a human-readable (or JSON in the case of --json) report of the changes that would have been made to the package tree, had it not been a --dry-run install.

Steps To Reproduce:

Run any reification command with --dry-run

Environment:

npm v7, all environments

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing a reification command such as install, prune, dedupe, update, or audit fix with --dry-run and inspect the Arborist.reify() path. Compare the current human-readable output with the expected report of changes that would have occurred, including JSON output for --json; done means the report is no longer misleading.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.