.yarnrc

What is a .yarnrc file?

Yarn Classic config — registry, install behaviour, network settings. Yarn Berry (Yarn 2+) uses `.yarnrc.yml` instead.

Use caution
Type Code
By Sebastian McKenzie / Facebook (Yarn)
MIME text/plain

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

Yarn 1 (now called "Classic") used .yarnrc — same INI-style format as .npmrc, but read by Yarn instead of npm. It sets the registry URL, install behaviour, mirror caches, and other Yarn-specific options. The classic Yarn workflow has been mostly drop-in compatible with npm: same package.json, same node_modules layout, just a different CLI (`yarn install` instead of `npm install`).

Yarn Berry (Yarn 2+, released 2020) replaced .yarnrc with .yarnrc.yml. The new YAML format supports Yarn's plug-and-play architecture (no node_modules), zero-installs (commit dependencies to the repo as compressed bundles), and constraints (lint-style rules across a monorepo). If a project has both .yarnrc and .yarnrc.yml, or only .yarnrc.yml, it's using Berry.

Most projects on Yarn Classic could equivalently switch to npm, pnpm, or Yarn Berry — the package.json is the same. The .yarnrc itself rarely needs more than `registry "https://npm.your-company.com/"` for private registries. CLI is `yarn install`, `yarn add`, `yarn upgrade`. Yarn Classic entered maintenance mode in 2022 with no further feature development planned.

Technical details
Full Name
.yarnrc
MIME Type
text/plain
Developer
Sebastian McKenzie / Facebook (Yarn)
Magic Bytes
N/A
Safety
.yarnrc requires caution. May contain auth tokens for private registries. Use environment variable interpolation rather than hardcoded tokens, and never commit auth-bearing .yarnrc files.
What opens it
Any text editor
FREE All
VS Code
FREE All
FAQ
Should I use Yarn Classic, Yarn Berry, npm, or pnpm in 2026?
For new projects: pnpm is the strongest default — fast, disk-efficient, strict dependency resolution. npm is fine if you want the boring choice. Yarn Berry is excellent for monorepos but has a steeper learning curve. Yarn Classic is in maintenance mode and not recommended for new projects.
What's the difference between .yarnrc and .yarnrc.yml?
.yarnrc is the Classic format (INI-style key-value pairs). .yarnrc.yml is the Berry format (YAML, richer config). They're not interchangeable — Classic only reads .yarnrc, Berry only reads .yarnrc.yml. Migration tools exist if you're upgrading from Classic to Berry.
Related formats