Skip to content
Latchkey

Yarn Berry "Plugin not found" - Fix .yarnrc.yml Plugin Imports in CI

Yarn Berry loads plugins listed under plugins: in .yarnrc.yml, usually from a committed file under .yarn/plugins. In CI it fails when that plugin file is not committed (gitignored) or the path/URL is unreachable, so Yarn cannot load the plugin it needs.

What this error means

A Yarn command fails because a plugin referenced in .yarnrc.yml cannot be found or loaded. It typically appears in CI when .yarn/plugins is gitignored or the workflow checked out a tree missing the plugin file.

Yarn output
Couldn't find a plugin named "@yarnpkg/plugin-workspace-tools" in the
project; did you forget to run "yarn plugin import"?
# .yarnrc.yml references .yarn/plugins/@yarnpkg/plugin-*.cjs
# but that file is not committed

Common causes

The plugin file is not committed

Yarn Berry expects plugin .cjs files under .yarn/plugins to be committed. If .yarn/plugins is gitignored, CI checks out a tree that references a plugin file that is not there.

A plugin path or URL that CI cannot reach

A .yarnrc.yml entry pointing at a path or remote URL not available in the CI checkout/network fails to load.

How to fix it

Commit the plugins and the .yarnrc.yml entry

Import the plugin (which writes the file + config) and commit both.

Terminal
yarn plugin import @yarnpkg/plugin-workspace-tools
git add .yarn/plugins .yarnrc.yml
git commit -m "chore: vendor yarn plugin"

Verify the checkout includes Yarn’s files

  1. Check .gitignore does not exclude .yarn/plugins (or the .yarn/releases Yarn binary).
  2. Confirm .yarnrc.yml paths are repo-relative and committed.
  3. Run yarn plugin runtime to list what Yarn actually loaded.

How to prevent it

  • Commit .yarn/plugins and .yarnrc.yml together.
  • Do not gitignore Yarn Berry’s vendored files.
  • Verify loaded plugins with yarn plugin runtime.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →