npm / npm/cli

[BUG] `npm audit fix --force` not properly moving directories

Open
#5,254 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Needs Triage Release 8.x
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 audit fix --force is consistently not correctly moving directories and their associated files and subdirectories. This has meant the only way to proceed is to manually recursively copy then delete from whatever source and target directories that are necessary for the fix. The examples I've come across are for the acorn-walk, acorn-globals and babel-loader projects, but I'm assuming I will come across more as I continue.

Expected Behavior

npm audit fix --force is able to move directories as expected when making updates.

Steps To Reproduce
  1. In this environment... (?)
  2. With this config... (?)
  3. Run npm audit fix --force
  4. See error below
Screen Shot 2022-08-03 at 13 48 03
Environment
  • npm: 8.16.0
  • Node.js: v18.7.0
  • OS Name: macOS Monterey 12.5
  • System Model Name: Apple MacBook Air (13", M1, 2020)
  • npm config:
; node bin location = /Users/tkiral/.nvm/versions/node/v18.7.0/bin/node
; node version = v18.7.0
; npm local prefix = /Users/tkiral/projects/humble_phones
; npm version = 8.16.0
; cwd = /Users/tkiral/projects/humble_phones
; HOME = /Users/tkiral

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 the directory-move failure with npm 8.16.0, Node.js v18.7.0, and the described macOS environment; the issue provides no source files or tests to begin from. Done means npm audit fix --force correctly moves directories and their associated files and subdirectories without requiring manual copying and deletion.

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.