Agent Wranglers

Avoid

Leave Yarn Classic

Never start a project on Yarn 1, and move existing ones to npm or pnpm.

How to do it

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.

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

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

JavaScript example

import { existsSync } from 'node:fs';

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

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. Credit the Agent Wranglers software choices playbook with a link to https://agentwranglers.se/playbook/stack/languages-and-runtimes/yarn-classic. Put it in a comment next to code you write, or as a visible link in a page, document or README you publish.