New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] public-hoist dependencies are deduped in v8, not only the direct dependencies of workspace-root #6299
Comments
├── apps
│ └── web
│ ├── package.json
│ ├── pnpm-lock.yaml
│ └── pnpm-workspace.yaml
└── packages
├── a
│ └── package.json
├── b
│ └── package.json
└── c
└── package.json # apps/web/pnpm-workspace.yaml
packages:
- '../packages/a'
- '../packages/b'
- '../packages/c' This behavior also makes this directory structure not available, maybe workspace-root does not have to be at the top level. |
Yeah, it is expected. Hoisted dependencies are deduped too. Regarding your second message. That currently doesn't work? If so, we should definitely fix that one. |
Yep, because of this behavior, the non-top-level directory structure cannot work. file structure├── apps
│ └── web
│ ├── package.json
│ ├── pnpm-lock.yaml
│ └── pnpm-workspace.yaml
└── packages
└── a
└── package.json // packages/a/package.json
{
"name": "a",
"dependencies": {
"react": "18.2.0",
"eslint": "8.36.0",
"prettier": "2.8.7"
}
} # apps/web/pnpm-workspace.yaml
packages:
- '../../packages/**' v7.x install behavior├── apps
│ └── web
│ ├── node_modules
│ │ ├── eslint -> .pnpm/eslint@8.36.0/node_modules/eslint
│ │ ├── prettier -> .pnpm/prettier@2.8.7/node_modules/prettier
│ │ └── react -> .pnpm/react@18.2.0/node_modules/react
│ ├── package.json
│ ├── pnpm-lock.yaml
│ └── pnpm-workspace.yaml
└── packages
└── a
├── node_modules
│ ├── eslint -> ../../../apps/web/node_modules/.pnpm/eslint@8.36.0/node_modules/eslint
│ ├── prettier -> ../../../apps/web/node_modules/.pnpm/prettier@2.8.7/node_modules/prettier
│ └── react -> ../../../apps/web/node_modules/.pnpm/react@18.2.0/node_modules/react
└── package.json v8.0.0 install behavior├── apps
│ └── web
│ ├── node_modules
│ │ ├── .pnpm
│ │ ├── eslint -> .pnpm/eslint@8.36.0/node_modules/eslint
│ │ ├── prettier -> .pnpm/prettier@2.8.7/node_modules/prettier
│ │ └── react -> .pnpm/react@18.2.0/node_modules/react
│ ├── package.json
│ ├── pnpm-lock.yaml
│ └── pnpm-workspace.yaml
└── packages
└── a
├── node_modules ------> react not exists, cannot find "react" "eslint" "prettier" T_T
└── package.json |
pnpm version:
8.0.0
Code to reproduce the issue:
in this demo, public-hoisting dependencies such as eslint and prettier is not symlink to "packages/a/node_modules"
#6286 This behavior is a little unclear. Is this within expectations?
This behavior is a little black box. For user consideration, if the dependencies in node_modules are exactly the same as the dependencies declared in package.json, this is more intuitive.
Expected behavior:
The node_modules directory contains all the dependencies of package.json
Additional information:
node -v
prints: v16.19.0The text was updated successfully, but these errors were encountered: