---
title: "Leave Yarn Classic · Agent Wranglers"
url: https://agentwranglers.se/playbook/stack/languages-and-runtimes/yarn-classic
updated: 2026-10-21
licence: "All rights reserved"
---

# Leave Yarn Classic

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- Level: Avoid
- Chapter: [Languages and runtimes](https://agentwranglers.se/playbook/stack/languages-and-runtimes)
- Rule: Never start a project on Yarn 1, and move existing ones to npm or pnpm.
- How: Yarn 1 fails the maintenance test. Its last release, 1.22.22, came out in March 2024, and it is frozen. It still had 5.3 million downloads in the week to 18 October 2026, mostly from old projects. Newer Yarn lines work very differently, so a move to npm costs about the same. Delete `yarn.lock`, run `npm install` once and commit the new `package-lock.json`. It fails [Pick software that still ships releases](https://agentwranglers.se/playbook/stack/how-to-choose/still-maintained).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Shell example

```sh
rm yarn.lock
npm install
git add package-lock.json
```

### JavaScript example

```js
import { existsSync } from 'node:fs';

export const usesYarnClassic = dir => existsSync(`${dir}/yarn.lock`) && !existsSync(`${dir}/.yarnrc.yml`);
```

## Sources

- [Yarn](https://yarnpkg.com/)

## Related rules

- [Pick software that still ships releases](https://agentwranglers.se/playbook/stack/how-to-choose/still-maintained) in Software choices

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/stack/languages-and-runtimes/yarn-classic">Agent Wranglers software choices playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Leave runtimes that are out of support](https://agentwranglers.se/playbook/stack/languages-and-runtimes/end-of-life-runtimes)
- [Languages and runtimes](https://agentwranglers.se/playbook/stack/languages-and-runtimes)
