npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.46k stars 3.15k forks source link

[BUG] workspaces `install-strategy = "nested"` does not install/ignores dependencies #6874

Open samuelstroschein opened 1 year ago

samuelstroschein commented 1 year ago

Is there an existing issue for this?

This issue exists in the latest npm version

Current Behavior

npm does not install dependencies of package-b when install-strategy = "nested", and package-b is nested in another package (package-a). Not in the root of the workspace or the package itself.

- package-a
  - package-b
    package.json (dependencies of b)
  package.json (dependencies of a)
- package.json (workspaces)

Expected Behavior

Install the dependencies of package-b.

Steps To Reproduce

  1. clone https://github.com/samuelstroschein/reproduction-npm-nested-packages-bug
  2. run npm i

Environment

access = "public" legacy-peer-deps = false

; "project" config from /Users/samuel/Desktop/repro/.npmrc

install-strategy = "nested"

; node bin location = /Users/samuel/.nvm/versions/node/v20.8.0/bin/node ; node version = v20.8.0 ; npm local prefix = /Users/samuel/Desktop/repro ; npm version = 10.1.0 ; cwd = /Users/samuel/Desktop/repro ; HOME = /Users/samuel ; Run npm config ls -l to show all defaults.

samuelstroschein commented 1 year ago

maybe related https://github.com/npm/cli/issues/4774 but npm <8.5 also doesn't work

mryckman commented 8 months ago

I think I'm having this same issue. It seems like a standard install-strategy="nested" just doesn't work at all. Anybody know if there are any updates on this?