Prettier "Cannot find plugin" - Fix Missing Prettier Plugins in CI
Prettier tried to load a plugin named in your config and could not find it. The plugin is referenced in .prettierrc (or the prettier key) but was never installed - or only installed locally and not declared as a dependency.
What this error means
Running Prettier (directly or via prettier --check in CI) fails with Cannot find plugin "<x>" or Couldn't resolve plugin "<x>", naming the plugin from your config.
[error] Cannot find plugin "prettier-plugin-tailwindcss". Did you forget to
install it?
[error] Resolved config from '/app/.prettierrc' references a missing plugin.Common causes
Plugin not installed
A plugin listed in .prettierrc plugins (e.g. prettier-plugin-tailwindcss, @prettier/plugin-php) is not in package.json, so a clean install does not provide it.
Plugin path/name wrong
A misspelled plugin name, or a path-style reference that does not resolve from the config location, fails to load.
How to fix it
Install the plugins your config lists
Add every plugin named in .prettierrc as a dev dependency.
npm install -D prettier prettier-plugin-tailwindcss
npm ls prettier-plugin-tailwindcssReference plugins by resolvable name
List the installed package name in the config.
// .prettierrc
{ "plugins": ["prettier-plugin-tailwindcss"] }How to prevent it
- Declare every Prettier plugin in
devDependencies. - Install with
npm ciso CI matches the lockfile. - Keep
.prettierrcpluginsentries pointed at installed packages.