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,