{"record":{"id":"202cd22a2cf18e48","repo":"paperclipai/paperclip","slug":"downgrade-cancelled-re-run-with-yes-to-confirm","errorCode":null,"errorMessage":"Downgrade cancelled. Re-run with --yes to confirm explicitly.","messagePattern":"Downgrade cancelled\\. Re-run with --yes to confirm explicitly\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/update.ts","lineNumber":224,"sourceCode":"    try {\n      restarted = await (overrides.restartActiveService ?? restartActiveManagedService)(installed.version);\n    } catch (error) {\n      return rollbackAfterServiceValidationFailure(\n        paths,\n        overrides.restartActiveService ?? restartActiveManagedService,\n        error,\n        \"Updated git payload\",\n      );\n    }\n    emit(options, { mode, source: \"git\", changed: true, currentSha: manifest.sha, targetSha, reused: installed.reused, restarted }, pc.yellow(`Updated unreleased git payload ${manifest.sha.slice(0, 12)} → ${targetSha.slice(0, 12)} from ${manifest.repo}@${manifest.ref}${restarted ? \" and restarted the active service\" : \"\"}.`));\n    return;\n  }\n  const targetVersion = await resolvePublishedVersion(request.spec, runCommand);\n  const currentVersion = manifest?.version ?? (mode === \"global-npm\" ? packageVersion : undefined);\n  const comparison = currentVersion ? compareVersions(targetVersion, currentVersion) : 1;\n  if (options.check) { emit(options, { mode, currentVersion: currentVersion ?? null, targetVersion, updateAvailable: comparison > 0, downgrade: comparison < 0, channel: request.channel }, comparison > 0 ? `Update available: ${targetVersion}` : comparison < 0 ? `Target ${targetVersion} is older than ${currentVersion}.` : `paperclipai ${targetVersion} is current.`); if (comparison > 0) process.exitCode = 10; return; }\n  if (mode === \"global-npm\") {\n    if (comparison < 0 && options.yes !== true) { const confirmed = await (overrides.confirm ?? defaultConfirm)(`Downgrade paperclipai from ${currentVersion} to ${targetVersion}?`); if (!confirmed) throw new Error(\"Downgrade cancelled. Re-run with --yes to confirm explicitly.\"); }\n    const args = [\"install\", \"-g\", `paperclipai@${targetVersion}`, `--registry=${PUBLIC_NPM_REGISTRY}`, `--@paperclipai:registry=${PUBLIC_NPM_REGISTRY}`]; console.log(`Running: npm ${args.join(\" \")}`);\n    if (!options.dryRun) {\n      const npmConfigDir = fs.mkdtempSync(path.join(os.tmpdir(), \"paperclip-npm-\"));\n      const npmUserConfigPath = path.join(npmConfigDir, \"npmrc\");\n      try {\n        fs.writeFileSync(npmUserConfigPath, `registry=${PUBLIC_NPM_REGISTRY}\\n@paperclipai:registry=${PUBLIC_NPM_REGISTRY}\\n`, { mode: 0o600 });\n        await runCommand(\"npm\", args, {\n          env: {\n            ...process.env,\n            npm_config_registry: PUBLIC_NPM_REGISTRY,\n            NPM_CONFIG_REGISTRY: PUBLIC_NPM_REGISTRY,\n            npm_config_userconfig: npmUserConfigPath,\n            NPM_CONFIG_USERCONFIG: npmUserConfigPath,\n          },\n          maxBuffer: 16 * 1024 * 1024,\n        });\n      } finally {\n        fs.rmSync(npmConfigDir, { recursive: true, force: true });","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/update.ts#L206-L242","documentation":"The update target resolves to a version older than the installed one and the operator declined the explicit downgrade confirmation; the downgrade is aborted by user choice.","triggerScenarios":"Thrown at cli/src/commands/update.ts:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run with --yes to confirm the downgrade explicitly."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}