Tailwind "PostCSS plugin tailwindcss requires PostCSS 8" in CI
Tailwind's PostCSS plugin checks the PostCSS major version at load time. When PostCSS 7 is resolved instead of 8, Tailwind refuses to run and prints a version-mismatch error.
What this error means
The CSS build fails with "It looks like you're trying to use tailwindcss with PostCSS 7" or "PostCSS plugin tailwindcss requires PostCSS 8".
Error: It looks like you're trying to use tailwindcss with PostCSS 7.
However, this version of Tailwind CSS requires PostCSS 8.
Please upgrade your PostCSS installation.Common causes
An old PostCSS 7 is hoisted in CI
A different dependency pulls PostCSS 7, and a clean CI install resolves it ahead of 8, so Tailwind sees the wrong major.
A toolchain still expects the PostCSS 7 compatibility build
A legacy build pipeline pinned the old @tailwindcss/postcss7-compat, which conflicts with a modern Tailwind expecting PostCSS 8.
How to fix it
Install PostCSS 8
- Add
postcss@^8andautoprefixeras devDependencies. - Remove any postcss7 compatibility package.
- Reinstall and re-run the CSS build.
npm install --save-dev postcss@^8 autoprefixer tailwindcssDeduplicate PostCSS
If multiple PostCSS versions are installed, dedupe so only 8 remains on the resolution path.
npm dedupe postcssHow to prevent it
- Pin
postcss@^8so the Tailwind plugin always finds a compatible major. - Drop legacy postcss7 compatibility packages when upgrading Tailwind.
- Run a clean install in CI so hoisting differences surface early.