{"record":{"id":"e2130dc2f049433e","repo":"hcengineering/platform","slug":"no-versions-found-for-the-specified-version-range-e2130d","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/core/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/core/common/scripts/install-run.js#L502-L538","documentation":"After collecting versions returned by `npm view`, the script picks the highest candidate. If the versions list is empty or no candidate survives (latestVersion stays falsy), it throws this error; note it is then re-wrapped by the outer catch as 'Unable to resolve version ... of package ...'.","triggerScenarios":"`npm view` succeeded but returned an empty/null versions list — typically when the given version range matches no published version (e.g. a version that was unpublished or a range with no satisfying release).","commonSituations":"Requesting a package version that was unpublished; pinning a range like >=6.0.0 for a package whose latest is 5.x; registry dist-tags empty for scoped packages.","solutions":["Use a version range that matches a published version (check `npm view <name> versions`)","If the outer error 'Unable to resolve version X of package Y' appears, read the nested cause for this message","Pin an exact known-good version in rush.json/install-run invocation instead of a broad range"],"exampleFix":"// before\nnode install-run-rush.js rush@>=99.0.0\n// after\nnode install-run-rush.js rush@5.100.1","handlingStrategy":"validation","validationCode":"const versions = JSON.parse(child_process.execSync(`npm view ${name} versions --json`).toString());\nif (!Array.isArray(versions) || versions.length === 0) throw new Error(`No published versions for ${name}`);","typeGuard":null,"tryCatchPattern":"try { resolveVersion(name, range); }\ncatch (e) { if (/Unable to resolve version|No versions found for the specified range/.test(e.message)) { console.error('Pick an existing version: npm view ' + name + ' versions'); } else throw e; }","preventionTips":["Pin exact versions that exist in the registry","Avoid ranges above the package's latest major","Check for unpublished versions after odd resolution failures"],"tags":["npm","version-resolution","registry"],"backgroundTag":"no-matching-package-version","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}