mirror of
https://github.com/zhigang1992/yarn.git
synced 2026-04-30 02:05:06 +08:00
Fixes dependencies using bins from their own dependencies (#6712)
This commit is contained in:
@@ -203,11 +203,21 @@ export async function makeEnv(
|
||||
}
|
||||
}
|
||||
|
||||
const pnpFile = `${config.lockfileFolder}/${constants.PNP_FILENAME}`;
|
||||
if (await fs.exists(pnpFile)) {
|
||||
let pnpFile;
|
||||
|
||||
if (process.versions.pnp) {
|
||||
pnpFile = dynamicRequire.resolve('pnpapi');
|
||||
} else {
|
||||
const candidate = `${config.lockfileFolder}/${constants.PNP_FILENAME}`;
|
||||
if (await fs.exists(candidate)) {
|
||||
pnpFile = candidate;
|
||||
}
|
||||
}
|
||||
|
||||
if (pnpFile) {
|
||||
const pnpApi = dynamicRequire(pnpFile);
|
||||
|
||||
const packageLocator = pnpApi.findPackageLocator(`${config.cwd}/`);
|
||||
const packageLocator = pnpApi.findPackageLocator(`${cwd}/`);
|
||||
const packageInformation = pnpApi.getPackageInformation(packageLocator);
|
||||
|
||||
for (const [name, reference] of packageInformation.packageDependencies.entries()) {
|
||||
|
||||
Reference in New Issue
Block a user