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/vue@2.7.16/node_modules/vue #vue@2.7 in the root directory
├── package.json
├── packages
│ └── test
│ ├── index.js
│ ├── node_modules
│ │ └── vue -> ../../../node_modules/.pnpm/vue@3.2.47/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(vue@2.7)
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: