You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a monorepo setup, if both the subdirectory and the parent directory have the same dependency, retrieving the dependency from package.json can cause errors.
├── node_modules
│ └── vue -> .pnpm/[email protected]/node_modules/vue #[email protected] in the root directory
├── package.json
├── packages
│ └── test
│ ├── index.js
│ ├── node_modules
│ │ └── vue -> ../../../node_modules/.pnpm/[email protected]/node_modules/vue #vue@3 in the subdirectory
│ └── package.json
├── pnpm-lock.yaml
└── pnpm-workspace.yaml
// packages/test/index.jsimport{resolvePathSync}from'mlly'importprocessfrom'node:process'console.log('current dir',process.cwd())consturl=resolvePathSync('vue/package.json',{url: process.cwd()})console.log('resolved url',url)// The output URL points to the dependency path in the parent directory([email protected])
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
node22
Reproduction
https://github.com/wkeylin/mlly-demo
Describe the bug
In a monorepo setup, if both the subdirectory and the parent directory have the same dependency, retrieving the dependency from package.json can cause errors.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: