{"record":{"id":"df265f7704bbbedc","repo":"hcengineering/platform","slug":"no-versions-found-for-the-specified-version-range","errorCode":null,"errorMessage":"No versions found for the specified version range.","messagePattern":"No versions found for the specified version range\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"foundations/communication/common/scripts/install-run.js","lineNumber":520,"sourceCode":"            const platformNpmPath = _getPlatformPath(npmPath);\n            const npmVersionSpawnResult = child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync(platformNpmPath, ['view', `${name}@${version}`, 'version', '--no-update-notifier', '--json'], spawnSyncOptions);\n            if (npmVersionSpawnResult.status !== 0) {\n                throw new Error(`\"npm view\" returned error code ${npmVersionSpawnResult.status}`);\n            }\n            const npmViewVersionOutput = npmVersionSpawnResult.stdout.toString();\n            const parsedVersionOutput = JSON.parse(npmViewVersionOutput);\n            const versions = Array.isArray(parsedVersionOutput)\n                ? parsedVersionOutput\n                : [parsedVersionOutput];\n            let latestVersion = versions[0];\n            for (let i = 1; i < versions.length; i++) {\n                const latestVersionCandidate = versions[i];\n                if (_compareVersionStrings(latestVersionCandidate, latestVersion) > 0) {\n                    latestVersion = latestVersionCandidate;\n                }\n            }\n            if (!latestVersion) {\n                throw new Error('No versions found for the specified version range.');\n            }\n            return latestVersion;\n        }\n        catch (e) {\n            throw new Error(`Unable to resolve version ${version} of package ${name}: ${e}`);\n        }\n    }\n}\nlet _rushJsonFolder;\n/**\n * Find the absolute path to the folder containing rush.json\n */\nfunction findRushJsonFolder() {\n    if (!_rushJsonFolder) {\n        let basePath = __dirname;\n        let tempPath = __dirname;\n        do {\n            const testRushJsonPath = path__WEBPACK_IMPORTED_MODULE_3__.join(basePath, RUSH_JSON_FILENAME);","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/foundations/communication/common/scripts/install-run.js#L502-L538","documentation":"After `npm view` returns versions, _resolvePackageVersion picks the highest candidate into latestVersion. If latestVersion is still falsy — the versions list was empty (or npm returned an empty JSON result) — it throws this error. Note this throw itself is immediately caught and rewrapped by error 16's handler in normal flow.","triggerScenarios":"npm view returned status 0 but an empty version list for the requested range, e.g. an exact version matching nothing, an invalid range string, or a package whose published versions don't satisfy the range.","commonSituations":"Requesting a not-yet-published version; typo'd semver range like \"^ v1.2.3\"; querying an npm dist-tag shape that returns empty; recently unpublished package.","solutions":["Verify the version range is valid semver and that versions satisfying it exist (`npm view <name> versions`).","Use an explicit existing version instead of a range.","Check the package wasn't unpublished (`npm view <name>`).","Handle the outer wrap error (error 16) and inspect its cause string for this message."],"exampleFix":"// before\nnode install-run.js pnpm@^99.0.0 -- pnpm -v\n// after: use a range that matches published versions\nnode install-run.js pnpm@8 -- pnpm -v","handlingStrategy":"validation","validationCode":"const range = '8';\nconst { execSync } = require('child_process');\nconst out = JSON.parse(execSync(`npm view pnpm@${range} version --json`).toString());\nif (!(Array.isArray(out) ? out.length : out)) throw new Error(`range ${range} matches no published version`);","typeGuard":null,"tryCatchPattern":"try { runInstall(); } catch (e) { if (/No versions found for the specified version range/.test(e.message) || /Unable to resolve version.*No versions found/.test(e.message)) { console.error('Use a valid semver range; list versions with npm view <pkg> versions'); process.exit(2); } throw e; }","preventionTips":["Resolve ranges with `npm view <pkg> versions --json` before use","Pin exact versions for reproducible CI","Beware of ranges against unpublished or renamed packages"],"tags":["npm","semver","versioning"],"backgroundTag":"no-matching-version","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}