{"record":{"id":"f77686e20439f10a","repo":"rohitg00/agentmemory","slug":"no-package-json-in-current-directory-skipping-js","errorCode":null,"errorMessage":"No package.json in current directory. Skipping JS dependency upgrade.","messagePattern":"No package\\.json in current directory\\. Skipping JS dependency upgrade\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/cli.ts","lineNumber":3197,"sourceCode":"      requireSuccess(installOk, \"pnpm install\");\n      runCommand(pnpmBin, [\"up\", \"iii-sdk@0.11.2\"], {\n        label: \"Pinning iii-sdk@0.11.2\",\n        optional: true,\n      });\n    } else if (npmBin) {\n      const installOk = runCommand(npmBin, [\"install\"], {\n        label: \"Refreshing dependencies (npm install)\",\n      });\n      requireSuccess(installOk, \"npm install\");\n      runCommand(npmBin, [\"install\", \"iii-sdk@0.11.2\"], {\n        label: \"Pinning iii-sdk@0.11.2\",\n        optional: true,\n      });\n    } else {\n      p.log.warn(\"No package manager found (pnpm/npm). Skipping JS dependency upgrade.\");\n    }\n  } else {\n    p.log.warn(\"No package.json in current directory. Skipping JS dependency upgrade.\");\n  }\n\n  const upgradeEngine = await p.confirm({\n    message: \"Re-run the iii-engine install script (curl | sh)?\",\n    initialValue: true,\n  });\n  if (p.isCancel(upgradeEngine)) {\n    p.cancel(\"Cancelled.\");\n    return process.exit(0);\n  }\n  if (upgradeEngine === true) {\n    await runIiiInstaller();\n  } else {\n    p.log.info(\"Skipped iii-engine installer.\");\n  }\n\n  if (dockerBin) {\n    runCommand(dockerBin, [\"pull\", `iiidev/iii:${IIPINNED_VERSION}`], {","sourceCodeStart":3179,"sourceCodeEnd":3215,"githubUrl":"https://github.com/rohitg00/agentmemory/blob/e04ba88819c365c9acf9d6661ea802143e728bd6/src/cli.ts#L3179-L3215","documentation":"A warning emitted by the `upgrade` command when the current working directory has no package.json, so there is nothing to upgrade and the JS dependency step is skipped. The upgrade continues to the engine reinstall prompt.","triggerScenarios":"Running the upgrade command from a directory that does not contain a package.json file.","commonSituations":"Running `agentmemory upgrade` from the home directory or an unrelated project instead of the project that depends on iii-sdk/agentmemory.","solutions":["cd into the project directory that contains the package.json and re-run the upgrade","Run `npm init -y` first if you intend to set up a new project here","Upgrade manually in the right project: npm install iii-sdk@0.11.2"],"exampleFix":"// before\n$ cd ~ && agentmemory upgrade\n// after\n$ cd ~/my-agent-project && agentmemory upgrade","handlingStrategy":"validation","validationCode":"const fs = require(\"fs\");\nif (!fs.existsSync(\"package.json\")) console.error(\"Run the upgrade from a directory containing package.json\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run upgrade from the project root","Check `ls package.json` before upgrading","Pin the working directory in scripts/cron jobs"],"tags":["cli","package-json","upgrade"],"backgroundTag":"missing-package-json","analyzedSha":"e04ba88819c365c9acf9d6661ea802143e728bd6","analyzedAt":"2026-08-30T01:07:40.754Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}