{"record":{"id":"d70a4a35b15dc236","repo":"pnpm/pnpm","slug":"versioning-invalid-lane-name","errorCode":"VERSIONING_INVALID_LANE_NAME","errorMessage":"Invalid lane name: ${laneName}. \"main\" is the reserved default lane; spell it in lowercase to move packages back onto it.","messagePattern":"Invalid lane name: (.+?)\\. \"main\" is the reserved default lane; spell it in lowercase to move packages back onto it\\.","errorType":"exception","errorClass":"PnpmError","httpStatus":null,"severity":"error","filePath":"pnpm11/releasing/commands/src/lane/index.ts","lineNumber":110,"sourceCode":"  for (const [key, lane] of Object.entries(lanes)) {\n    for (const dir of refs.refToDirs(key)) {\n      laneByDir.set(dir, { key, lane })\n    }\n  }\n\n  let output: string\n  if (laneName === MAIN_LANE) {\n    for (const project of selected) {\n      const existing = laneByDir.get(project.dir)\n      if (existing != null) {\n        delete lanes[existing.key]\n      }\n    }\n    output = `Moved to the main lane:\\n${selected.map((project) => `  ${refFor(project, refs)}\\n`).join('')}` +\n      'The accumulated stable versions release on the next \"pnpm version -r\" run.'\n  } else {\n    if (laneName.toLowerCase() === MAIN_LANE) {\n      throw new PnpmError('VERSIONING_INVALID_LANE_NAME', `Invalid lane name: ${laneName}. \"main\" is the reserved default lane; spell it in lowercase to move packages back onto it.`)\n    }\n    // A purely numeric lane name is rejected because semver parses an\n    // all-digit prerelease identifier as a number, which changes sorting\n    // semantics.\n    if (!/^[0-9A-Z-]+$/i.test(laneName) || /^\\d+$/.test(laneName)) {\n      throw new PnpmError('VERSIONING_INVALID_LANE_NAME', `Invalid lane name: ${laneName}. Lane names may contain only alphanumerics and hyphens, and cannot be purely numeric.`)\n    }\n    for (const project of selected) {\n      const existing = laneByDir.get(project.dir)\n      if (existing != null && existing.lane !== laneName) {\n        throw new PnpmError('VERSIONING_ALREADY_ON_LANE', `${refFor(project, refs)} is already on the \"${existing.lane}\" lane. Move it back with \"pnpm lane main\" first.`)\n      }\n      if (existing == null) {\n        lanes[refFor(project, refs)] = laneName\n      }\n    }\n    output = `Moved to the \"${laneName}\" lane:\\n${selected.map((project) => `  ${refFor(project, refs)}\\n`).join('')}`\n  }","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/pnpm/pnpm/blob/6261b7f388016d57ca6b90340342411cd1d0d00f/pnpm11/releasing/commands/src/lane/index.ts#L92-L128","documentation":"Thrown by `pnpm lane <name>` when the name is a case variant of the reserved default lane — `Main`, `MAIN`, etc. — rather than the exact lowercase `main`. `main` is not a stored lane; it means \"move back onto the stable release track\", so a near-identical casing would create a real lane that shadows the reserved one.","triggerScenarios":"Any invocation where `laneName.toLowerCase() === 'main'` but `laneName !== 'main'`: `pnpm lane Main --filter <pkg>...`, `pnpm lane MAIN ...`.","commonSituations":"Capitalizing commands out of habit or autocorrect; scripting with a variable that got title-cased.","solutions":["Spell it lowercase: `pnpm lane main --filter <pkg>...`","For a genuine separate lane, pick a name that is not a case variant of `main`"],"exampleFix":"# before\npnpm lane Main --filter @acme/napi...\n# after\npnpm lane main --filter @acme/napi...","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"const MAIN_LANE = 'main'\nconst isAcceptableLaneName = (name) =>\n  name === MAIN_LANE || name.toLowerCase() !== MAIN_LANE","tryCatchPattern":null,"preventionTips":["Lowercase all lane names in scripts (`main`, `alpha`, `rc`)","Validate lane names in release tooling before shelling out to `pnpm lane`"],"tags":["lane","versioning","naming"],"backgroundTag":"reserved-name-rejected","analyzedSha":"6261b7f388016d57ca6b90340342411cd1d0d00f","analyzedAt":"2026-08-17T18:30:54.750Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}