From 6319a253779c5d3a363e5ac68c5c2df1f1bcb496 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sun, 30 Apr 2023 02:43:24 +0300 Subject: [PATCH] fix: linking bins of local deps, when node-linker is hoisted close #6486 --- .changeset/hot-buttons-train.md | 6 ++++++ pkg-manager/headless/src/index.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/hot-buttons-train.md diff --git a/.changeset/hot-buttons-train.md b/.changeset/hot-buttons-train.md new file mode 100644 index 00000000000..e4e9e76feed --- /dev/null +++ b/.changeset/hot-buttons-train.md @@ -0,0 +1,6 @@ +--- +"@pnpm/headless": patch +"pnpm": patch +--- + +Link the bin files of local workspace dependencies, when `node-linker` is set to `hoisted` [6486](https://github.com/pnpm/pnpm/issues/6486). diff --git a/pkg-manager/headless/src/index.ts b/pkg-manager/headless/src/index.ts index 0d2f61c2e9e..8b53ea6698b 100644 --- a/pkg-manager/headless/src/index.ts +++ b/pkg-manager/headless/src/index.ts @@ -516,7 +516,7 @@ export async function headlessInstall (opts: HeadlessOptions) { /** Skip linking and due to no project manifest */ if (!opts.ignorePackageManifest) { await Promise.all(selectedProjects.map(async (project) => { - if (opts.publicHoistPattern?.length && path.relative(opts.lockfileDir, project.rootDir) === '') { + if (opts.nodeLinker === 'hoisted' || opts.publicHoistPattern?.length && path.relative(opts.lockfileDir, project.rootDir) === '') { await linkBinsOfImporter(project, { extraNodePaths: opts.extraNodePaths, preferSymlinkedExecutables: opts.preferSymlinkedExecutables,