-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issue
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
An additional package is added as a dependency to existing workspaces, even though it is not listed as a dependency of the existing workspace in the package.json originally.
Expected Behavior
npm audit fix --force should only upgrade existing vulnerable dependencies. It should NOT add new dependencies to workspaces unless explicitly defined in the package.json originally.
Steps To Reproduce
- Clone the example repository
- Install dependencies using
npm ci. - Run
npm audit fix --forceto address all vulnerabilities. - The additional
@swc/cliis added to the workspacepackage-a, however, the workspacepackage-adoesn't need it.
Environment
- npm: 10.9.1
- Node.js: 21.5.0
- OS Name: macOS 14.6.1
- System Model Name: Macbook Pro 14-inch, 2021
- npm config:
; "user" config from /Users/jamie/.npmrc
; node bin location = /Users/jamie/.nvm/versions/node/v21.5.0/bin/node
; node version = v21.5.0
; npm local prefix = /Users/jamie/Sources/monorepo
; npm version = 10.9.1
; cwd = /Users/jamie/Sources/monorepo
; HOME = /Users/jamie
; Run `npm config ls -l` to show all defaults.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 2secondary priority issuesecondary priority issue