{"record":{"id":"1c5080a2f09d0674","repo":"hcengineering/platform","slug":"no-versions-found-for-the-specified-version-range-1c5080","errorCode":null,"errorMessage":"No versions found for the specified version range.","messagePattern":"No versions found for the specified version range\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"foundations/utils/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/utils/common/scripts/install-run.js#L502-L538","documentation":"After `npm view <name>@<version> version --json` succeeds, _resolvePackageVersion scans the returned versions and picks the maximum via _compareVersionStrings. If latestVersion remains falsy (empty array or empty output), it throws 'No versions found for the specified version range.'","triggerScenarios":"npm view returns an empty JSON array/string (no published versions match the requested range), or the parsed output yields no candidate versions.","commonSituations":"Requesting a version range that matches no published release (e.g. ^5.0.0 when only 4.x exists); querying a package that was unpublished; typos in the range in install-run command lines or package.json-like specs.","solutions":["Check which versions actually exist: `npm view <package> versions --json` and adjust the requested range","Fix typos in the version specifier passed to install-run","Publish the expected version if you own the package and it is missing","Use a broader range (e.g. `latest` or a lower major) if the exact major was never released"],"exampleFix":"// before\nnode install-run.js pnpm 7.99.0 -- pnpm install   // 7.99.0 never published\n// after\nnode install-run.js pnpm 7.33.6 -- pnpm install","handlingStrategy":"validation","validationCode":"const { execSync } = require('child_process');\nfunction assertVersionExists(name, range) {\n  const versions = JSON.parse(execSync(`npm view ${name} versions --json`, { encoding: 'utf8' }));\n  if (!Array.isArray(versions) || versions.length === 0) {\n    throw new Error(`Package ${name} has no published versions`);\n  }\n  // verify the requested range matches at least one published version\n  require('semver').minSatisfying(versions, range); // throws if none satisfy\n}\nassertVersionExists('pnpm', '9.15.0');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `npm view <pkg> versions --json` before pinning a version","Avoid ranges that match no release; use exact published versions","Verify package names for typos"],"tags":["npm","versioning","semver","registry"],"backgroundTag":"no-matching-package-version","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}