npm / npm/cli

[BUG] Windows Arborist Crash on rollbackMoveBackRetiredUnchanged

Open
#4,448 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is there an existing issue for this?
  • I have searched the existing issues
This issue exists in the latest npm version
  • I am using the latest npm
Current Behavior

npm install can crash when realFolders.get(retireFolder) returns undefined in the following code:

https://github.com/npm/cli/blob/dd63e21a0e192f5a7e797d6c89595fd09dbfd7b9/workspaces/arborist/lib/arborist/reify.js#L1065-L1078

Also see log ~line 3459.

Expected Behavior

It shouldn't crash.

Steps To Reproduce

I'm not entirely sure, since I haven't experienced this error. This person has though.

Environment
  • npm: v8.4.1
  • Node.js: v17.5.0
  • OS Name: Windows_NT 10.0.22557
  • System Model Name: Don't know
  • npm config: Don't know

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 in workspaces/arborist/lib/arborist/reify.js around the linked rollbackMoveBackRetiredUnchanged code, then inspect the attached failure log near line 3459. Compare the behavior with the linked reproduction issue, since this report does not provide reliable reproduction steps. Done means npm install no longer crashes when realFolders.get(retireFolder) is undefined.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.