diff --git a/.changeset/real-knives-bathe.md b/.changeset/real-knives-bathe.md index 9f9642f418b..d5c4092dfa8 100644 --- a/.changeset/real-knives-bathe.md +++ b/.changeset/real-knives-bathe.md @@ -1,5 +1,5 @@ --- -"@pnpm/plugin-commands-installation": patch +"@pnpm/config": patch --- -Fetches the local module real path +Fixes the local package real path diff --git a/config/config/src/index.ts b/config/config/src/index.ts index cde1899c38b..bbf5d8f1c3c 100644 --- a/config/config/src/index.ts +++ b/config/config/src/index.ts @@ -291,7 +291,7 @@ export async function getConfig ( ...rcOptions.map((configKey) => [camelcase(configKey), npmConfig.get(configKey)]) as any, // eslint-disable-line ...Object.entries(cliOptions).filter(([name, value]) => typeof value !== 'undefined').map(([name, value]) => [camelcase(name), value]), ]) as unknown as ConfigWithDeprecatedSettings - const cwd = betterPathResolve(cliOptions.dir ?? npmConfig.localPrefix) + const cwd = await fs.promises.realpath(betterPathResolve(cliOptions.dir ?? npmConfig.localPrefix)) pnpmConfig.maxSockets = npmConfig.maxsockets // @ts-expect-error diff --git a/pkg-manager/plugin-commands-installation/src/recursive.ts b/pkg-manager/plugin-commands-installation/src/recursive.ts index 6f5790627ab..bf77d8eb18f 100755 --- a/pkg-manager/plugin-commands-installation/src/recursive.ts +++ b/pkg-manager/plugin-commands-installation/src/recursive.ts @@ -170,7 +170,6 @@ export async function recursive ( const calculatedRepositoryRoot = await fs.realpath(calculateRepositoryRoot(opts.workspaceDir, importers.map(x => x.rootDir))) const isFromWorkspace = isSubdir.bind(null, calculatedRepositoryRoot) importers = await pFilter(importers, async ({ rootDir }: { rootDir: string }) => isFromWorkspace(await fs.realpath(rootDir))) - importers = await Promise.all(importers.map(async ({ rootDir, ...rest }) => ({ rootDir: await fs.realpath(rootDir), ...rest }))) if (importers.length === 0) return true let mutation!: string switch (cmdFullName) {