cli
cli copied to clipboard
[BUG] "npm outdated" always returns all outdated dependencies when passing "--workspace" argument (v8 and v9)
Is there an existing issue for this?
- [X] I have searched the existing issues
This issue exists in the latest npm version
- [X] I am using the latest npm
Current Behavior
Running any variation of npm outdated -w ./apps/my-app returns all outdated packages across all workspace packages:
npm outdated --workspace ./apps/my-app
npm outdated -w ./apps/my-app
npm outdated -w=./apps/my-app
npm outdated -w @my-org/my-app
npm outdated -w ./ # run in ./apps/my-app folder
I always see every outdated dependency across all my workspaces rather than just for the workspace package I input.
Have tried this on v8 and v9, same output
Expected Behavior
I should only see outdated dependencies for the given workspace package, not all workspace packages
Steps To Reproduce
- In a npm workspace
- Run
npm outdated -w ./packages/my-package - See that all package's outdated deps show, not the just the specific one requested
Environment
- npm: 9.3.1
- Node.js: v18.13.0
- OS Name: macOS 12.6
- System Model Name: Macbook Air (M2)
- npm config:
; "user" config from /Users/danawoodman/.npmrc
//registry.npmjs.org/:_authToken = (protected)
package-lock = true
save-exact = true
save-prefix = ""
; "project" config from /Users/danawoodman/code/my-project/.npmrc
@fortawesome:registry = "https://npm.fontawesome.com/"
//npm.fontawesome.com/:_authToken = (protected)
; "env" config from environment
prefix = "/Users/danawoodman/.asdf/installs/nodejs/18.13.0/.npm"
; node bin location = /Users/danawoodman/.asdf/installs/nodejs/18.13.0/bin/node
; node version = v18.13.0
; npm local prefix = /Users/danawoodman/code/my-project
; npm version = 9.3.1
; cwd = /Users/danawoodman/code/my-project
; HOME = /Users/danawoodman
; Run `npm config ls -l` to show all defaults.
That feeling when you hit the same issue, google it and then realize you've already filed a bug for it 🤦