fix(coding-agent): add pnpm self-update prune hint (#6279)
Adds a pnpm-specific self-update recovery hint when pi update fails during self-update. Fixes #6215.
This commit is contained in:
@@ -372,6 +372,11 @@ function printSelfUpdateFallback(command: SelfUpdateCommand): void {
|
||||
console.error(chalk.dim(`If this keeps failing, run this command yourself: ${command.display}`));
|
||||
}
|
||||
|
||||
function printPnpmSelfUpdateMetadataHint(): void {
|
||||
console.error(chalk.yellow("If pnpm reports missing package versions, its cached registry metadata may be stale."));
|
||||
console.error(chalk.yellow(`Run \`pnpm store prune\` and retry \`${APP_NAME} update --self\`.`));
|
||||
}
|
||||
|
||||
function printSelfUpdateNote(note: string): void {
|
||||
const trimmedNote = note.trim();
|
||||
if (!trimmedNote) {
|
||||
@@ -753,6 +758,9 @@ export async function handlePackageCommand(
|
||||
} catch (error: unknown) {
|
||||
const message = error instanceof Error ? error.message : "Unknown package command error";
|
||||
console.error(chalk.red(`Error: ${message}`));
|
||||
if (installMethod === "pnpm") {
|
||||
printPnpmSelfUpdateMetadataHint();
|
||||
}
|
||||
printSelfUpdateFallback(selfUpdateCommand);
|
||||
process.exitCode = 1;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user