{"record":{"id":"446182c086cd777e","repo":"diegosouzapw/OmniRoute","slug":"could-not-read-installed-version-from-node-modules-446182","errorCode":null,"errorMessage":"Could not read installed version from node_modules/9router/package.json","messagePattern":"Could not read installed version from node_modules/9router/package\\.json","errorType":"exception","errorClass":"InstallError","httpStatus":500,"severity":"error","filePath":"src/lib/services/installers/ninerouter.ts","lineNumber":88,"sourceCode":"      JSON.stringify(\n        { name: \"omniroute-9router-host\", version: \"0.0.0\", private: true, dependencies: {} },\n        null,\n        2\n      ),\n      \"utf8\"\n    );\n  }\n\n  await runNpm(\n    [\"install\", `${NINEROUTER_PACKAGE}@${version}`, \"--omit=dev\", \"--no-audit\", \"--no-fund\"],\n    // `--prefix` is passed via `prefix` (→ npm_config_prefix env) instead of an\n    // argv path so an install dir with spaces survives the Windows shell (#5379).\n    { cwd: NINEROUTER_INSTALL_DIR, prefix: NINEROUTER_INSTALL_DIR }\n  );\n\n  const installedVersion = await getInstalledVersion();\n  if (!installedVersion) {\n    throw new InstallError(\n      \"Could not read installed version from node_modules/9router/package.json\",\n      \"9router instalado mas versão não pôde ser lida.\",\n      500\n    );\n  }\n\n  await upsertVersionManagerTool({\n    tool: \"9router\",\n    installedVersion,\n    binaryPath: getServerPath(),\n    status: \"stopped\",\n  });\n\n  // Invalidate cache so next getLatestVersion() re-fetches\n  latestVersionCache = null;\n\n  return {\n    installedVersion,","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/services/installers/ninerouter.ts#L70-L106","documentation":"Post-install verification guard in the ninerouter installer: after `runNpm install` of the 9router package, getInstalledVersion() could not read a version from node_modules/9router/package.json. The install step appeared to succeed but the package manifest is missing or invalid — indicating a partial install, npm cache issue, or filesystem problem in NINEROUTER_INSTALL_DIR.","triggerScenarios":"Thrown at src/lib/services/installers/ninerouter.ts:88 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the ninerouter install directory and retry","Clear npm cache and verify npm can install the package standalone","Check disk space and permissions on the install dir","Review npm logs for silent extraction failures"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}