{"record":{"id":"2427a93400dccf8d","repo":"coder/code-server","slug":"yarn-is-no-longer-supported-please-use-npm-ins","errorCode":null,"errorMessage":"`yarn` is no longer supported; please use `npm install` instead","messagePattern":"`yarn` is no longer supported; please use `npm install` instead","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ci/dev/preinstall.js","lineNumber":2,"sourceCode":"if (process.env.npm_execpath.includes(\"yarn\")) {\n  throw new Error(\"`yarn` is no longer supported; please use `npm install` instead\")\n}\n","sourceCodeStart":1,"sourceCodeEnd":4,"githubUrl":"https://github.com/coder/code-server/blob/51f90a376b42e217b38937410fe2855e0c1db87e/ci/dev/preinstall.js#L1-L4","documentation":"code-server's preinstall lifecycle hook rejects yarn to enforce a single package manager (npm) and prevent lockfile/dependency drift. It inspects process.env.npm_execpath (the path to the running package manager binary) and aborts the install if the path contains 'yarn'. This keeps CI and contributor installs deterministic.","triggerScenarios":"Running `yarn` or `yarn install` in the code-server repo root, which invokes npm lifecycle scripts with npm_execpath pointing at the yarn binary. Also triggered by any wrapper (corepack, volta, asdf) that routes `install` through yarn.","commonSituations":"New contributors whose global default is yarn; monorepo tooling that auto-detects yarn from a stray yarn.lock; CI images that ship yarn as the default `install` command.","solutions":["Run `npm install` (or `npm ci` for reproducible installs) instead of `yarn`","If a package-manager wrapper is forcing yarn, pin it to npm for this repo (e.g. `corepack enable && corepack use npm`) or uninstall the shim","Remove any committed yarn.lock / .yarnrc.yml so tooling does not auto-detect yarn"],"exampleFix":"// before\nyarn install\n\n// after\nnpm install","handlingStrategy":"validation","validationCode":"// Run before invoking install in this repo\nconst execpath = process.env.npm_execpath || \"\"\nif (execpath.includes(\"yarn\")) {\n  console.error(\"This repo requires npm. Re-run with: npm install\")\n  process.exit(1)\n}\n// Or detect the active manager up front:\nconst pkgManager = execpath.includes(\"yarn\") ? \"yarn\"\n  : execpath.includes(\"pnpm\") ? \"pnpm\" : \"npm\"\nif (pkgManager !== \"npm\") throw new Error(`Use npm, not ${pkgManager}`)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document `npm install` as the only supported install command in CONTRIBUTING/README","Do not commit a yarn.lock; tooling auto-detects yarn from its presence","In CI, invoke `npm ci` explicitly rather than relying on a generic install step"],"tags":["build","package-manager","npm","contributor","lifecycle"],"backgroundTag":null,"analyzedSha":"51f90a376b42e217b38937410fe2855e0c1db87e","analyzedAt":"2026-08-12T11:27:34.273Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}