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.
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 committedCommon 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.
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
- Check
.gitignoredoes not exclude.yarn/plugins(or the.yarn/releasesYarn binary). - Confirm
.yarnrc.ymlpaths are repo-relative and committed. - Run
yarn plugin runtimeto 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.