{"record":{"id":"af172f882567ab76","repo":"diegosouzapw/OmniRoute","slug":"could-not-read-installed-version-from-node-modules-af172f","errorCode":null,"errorMessage":"Could not read installed version from node_modules/@askalf/dario/package.json","messagePattern":"Could not read installed version from node_modules/@askalf/dario/package\\.json","errorType":"exception","errorClass":"InstallError","httpStatus":500,"severity":"error","filePath":"src/lib/services/installers/dario.ts","lineNumber":142,"sourceCode":"      JSON.stringify(\n        { name: \"omniroute-dario-host\", version: \"0.0.0\", private: true, dependencies: {} },\n        null,\n        2\n      ),\n      \"utf8\"\n    );\n  }\n\n  await runNpm(\n    [\"install\", `${DARIO_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: installDir, prefix: installDir }\n  );\n\n  const installedVersion = await getInstalledVersion();\n  if (!installedVersion) {\n    throw new InstallError(\n      \"Could not read installed version from node_modules/@askalf/dario/package.json\",\n      \"Dario instalado mas versão não pôde ser lida.\",\n      500\n    );\n  }\n\n  await upsertVersionManagerTool({\n    tool: \"dario\",\n    installedVersion,\n    binaryPath: getCliPath(),\n    status: \"stopped\",\n    port: DARIO_DEFAULT_PORT,\n  });\n\n  // Invalidate cache so next getLatestVersion() re-fetches\n  latestVersionCache = null;\n\n  return {","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/services/installers/dario.ts#L124-L160","documentation":"Post-install verification guard in the Dario installer: after `runNpm install` of @askalf/dario into installDir, getInstalledVersion() found no readable version in node_modules/@askalf/dario/package.json. npm exited without error but the package.json is absent or unparseable — typically a partial/failed extraction, cache corruption, or a permission problem in the install directory.","triggerScenarios":"Thrown at src/lib/services/installers/dario.ts:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the Dario install directory and re-run the install","Run `npm cache clean --force` and retry","Confirm the service install dir is writable and not on a full disk","Check npm logs (npm log) for a silent extraction failure"],"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"}