[BUG] Installing dependencies of nested workspaces seems to not work properly in version 8.5+
Nobody has claimed this yet.
- 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
In my repository, I have a nested workspace structure that looks something like this:
root/
├─ test-1/
│ ├─ test-1a/
│ │ ├─ package.json
│ ├─ test-1b/
│ │ ├─ package.json
│ ├─ package.json
├─ test-2/
│ ├─ package.json
├─ package.json
./package.jsondefines the directoriestest-1andtest-2asworkspaces./test-1/package.jsondefines the directoriestest-1aandtest-1basworkspaces- These directories have their own dependencies:
./test-1a./test-1b./test2
The problem: Running npm install in ./test-1 doesn't result in installing dependencies from test-1a and test-1b in ./test-1/node_modules. The only thing that happens is symlinking ./test-1 in ./node_modules.
Expected Behavior
In versions up to 8.4.x, running npm install in a nested workspace (directory with is both a workspace for a parent directory and defines its own workspaces) resulted in installing the dependencies from workspaces defined in its package.json to ./path-to-nested-workspace/node_modules.
Steps To Reproduce
I created a repo with the setup I'm explaining.
Either see a workflow that installs dependencies of a nested workspace for 3 different npm versions:
Or:
- Clone https://github.com/jansiegel/nested-workspace-dependencies
- Run
npm installin the root directory cd test1npm install- See what was installed
Environment
- npm: 8.5.0+
- Node.js: v16.14.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the nested-workspace reproduction repository and its package.json files, then run the listed npm install steps with the affected npm versions. Compare the resulting node_modules contents and symlinks in test1 and its nested workspaces; done means dependencies from test-1a and test-1b are installed as expected.
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
- Mostly clear
- Newbie friendliness
- 48/100