{"record":{"id":"951e302873a4270f","repo":"jdx/mise","slug":"pnpm-lockfile-dependency-name-at-version-h","errorCode":null,"errorMessage":"pnpm lockfile dependency {name:?} at {version:?} has no package snapshot","messagePattern":"pnpm lockfile dependency (.+?) at (.+?) has no package snapshot","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/workspace/node.rs","lineNumber":444,"sourceCode":"    }\n    let packages = candidates\n        .into_iter()\n        .flat_map(|candidate| {\n            available\n                .iter()\n                .filter(move |package| {\n                    *package == &candidate\n                        || package\n                            .strip_prefix(&candidate)\n                            .is_some_and(|suffix| suffix.starts_with('('))\n                })\n                .cloned()\n        })\n        .collect::<BTreeSet<_>>();\n    if !packages.is_empty() {\n        return Ok(packages.into_iter().collect());\n    }\n    eyre::bail!(\"pnpm lockfile dependency {name:?} at {version:?} has no package snapshot\")\n}\n\nfn workspace_tasks(\n    manifest: &PackageJson,\n    package_manager: &str,\n    source: &Path,\n    turbo: Option<&TurboJson>,\n    workspace_root: &Path,\n) -> BTreeMap<String, WorkspaceTask> {\n    manifest\n        .scripts\n        .iter()\n        .map(|(name, script)| {\n            let command = shell_words::join([package_manager, \"run\", name, \"--\"]);\n            (\n                name.clone(),\n                WorkspaceTask {\n                    command,","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/workspace/node.rs#L426-L462","documentation":"resolve_package_keys looks up a dependency name+version in the lockfile's packages/snapshots section to find matching package keys. If no snapshot exists for that exact (name, version) pair, mise cannot build the dependency graph and bails. This typically means the lockfile's importer versions and snapshots section are out of sync.","triggerScenarios":"dependency_package_keys resolved a version (e.g. from an importer) but the lockfile's packages map contains no entry with that name/version — often after partial lockfile edits or peer-resolution suffix mismatches.","commonSituations":"Hand-merged pnpm-lock.yaml conflicts where snapshots were dropped; stale lockfile after changing package.json without running pnpm install; version strings with peer suffixes (e.g. 1.0.0_peer_deps@x) whose snapshots differ.","solutions":["Run `pnpm install` to reconcile importers with the packages/snapshots section.","Delete pnpm-lock.yaml and reinstall if it is corrupted or badly merged.","Resolve merge conflicts in pnpm-lock.yaml by regenerating rather than hand-editing.","Pin the dependency to a version that exists in the lockfile snapshots."],"exampleFix":"// before: hand-edited lockfile with importer version 2.0.0 but no snapshot\n// after\n$ rm pnpm-lock.yaml && pnpm install","handlingStrategy":"validation","validationCode":"// verify every importer version has a snapshot entry\nfor (const [name, version] of allImporterDeps()) {\n  if (!lock.snapshots?.[`${name}@${version}`] && !lock.packages?.[`${name}@${version}`]) {\n    console.warn(`missing snapshot for ${name}@${version}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  mise('run', 'task');\n} catch (e) {\n  if (/has no package snapshot/.test(e.message)) {\n    execSync('pnpm install --frozen-lockfile=false', { stdio: 'inherit' });\n  } else throw e;\n}","preventionTips":["Regenerate (not hand-merge) pnpm-lock.yaml on conflicts.","Keep package.json and pnpm-lock.yaml in sync via CI `pnpm install --frozen-lockfile` check."],"tags":["pnpm","lockfile","node","workspace"],"backgroundTag":"record-not-found","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}