From c096e480900256b9c4abf6c24cd14d9ae14b96cd Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sat, 7 Mar 2026 15:49:20 +0100 Subject: [PATCH] fix: show absolute path instead of ??? when globally linking from cwd (#10899) When running `pnpm add -g .`, the linked-from path equals the cwd, so path.relative() returns an empty string which is falsy, causing the fallback to '???'. Use the absolute path as fallback instead. Co-authored-by: Claude Opus 4.6 --- .changeset/fix-global-link-output.md | 6 ++++++ cli/default-reporter/src/reporterForClient/reportSummary.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix-global-link-output.md diff --git a/.changeset/fix-global-link-output.md b/.changeset/fix-global-link-output.md new file mode 100644 index 0000000000..8495ecad06 --- /dev/null +++ b/.changeset/fix-global-link-output.md @@ -0,0 +1,6 @@ +--- +"@pnpm/default-reporter": patch +"pnpm": patch +--- + +Fixed global install output showing `???` instead of the linked package path when linking from the current directory. diff --git a/cli/default-reporter/src/reporterForClient/reportSummary.ts b/cli/default-reporter/src/reporterForClient/reportSummary.ts index affa96805f..ad63f7a3d1 100644 --- a/cli/default-reporter/src/reporterForClient/reportSummary.ts +++ b/cli/default-reporter/src/reporterForClient/reportSummary.ts @@ -118,7 +118,7 @@ function printDiffs ( result += ` ${chalk.red('deprecated')}` } if (pkg.from) { - result += ` ${chalk.grey(`<- ${pkg.from && path.relative(opts.prefix, pkg.from) || '???'}`)}` + result += ` ${chalk.grey(`<- ${path.relative(opts.prefix, pkg.from) || pkg.from}`)}` } if (pkg.added && depType === 'dev' && opts.pnpmConfig?.saveDev === false && opts.cmd === 'add') { result += `${chalk.yellow(' already in devDependencies, was not moved to dependencies.')}`