[BUG] not installing peer dependencies for workspaces if they are not nested inside the root package
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Current Behavior:
having 'library-project' with peer-dependencies adjacent to 'main-project'
and 'main-project' with workspaces: ['../library-project'] (outside of 'main-project' folder)
'npm install' in 'main-project' is not installing the peer-dependencies
example:
library-project/
package.json // peerDependencies: {"dep-a": "1.0.0"}
main-project/
package.json // "workspaces": [ "../library-project" ]
Expected Behavior:
expecting node_modules in 'main-project' after 'npm i' to include 'dep-a':
node_modules
library-project (linked)
dep-a
actual result: missing 'dep-a' in node_modules
this works fine if 'library-project' would be inside 'main-project'
Steps To Reproduce:
-
main-project and library-project are two adjacent projects
-
main-project package.json:
{
"name": "main-project",
"version": "1.0.0",
"workspaces": [
"../library-project"
],
"dependencies": {
"library-project": "1.0.0"
}
}
- library-project package.json:
{
"name": "library-project",
"version": "1.0.0",
"peerDependencies": {
"@angular/core": "11.1.2"
}
}
-
run 'npm install' in 'main-project'
-
expected "@angular/core" to be installed as it's a peer dependency of 'library-project'
Environment:
- Node: 15.6.0
- npm: 7.5.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
Reproduce the issue with adjacent main-project and library-project directories using the package.json files and npm 7.5.2 described here. Start by tracing workspace linking and peer-dependency installation for a workspace outside the root; done when running npm install in main-project installs the library project's peer dependency, such as @angular/core, in main-project/node_modules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100