# Fix Tailwind 'unable to resolve dependency tree' in Next.js

> Learn how to fix the unable to resolve dependency tree error when installing Tailwind in a Next.js project by installing tailwindcss@latest and postcss@latest.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2021-05-03 | Topics: [Next.js](https://flaviocopes.com/tags/next/) | Canonical: https://flaviocopes.com/nextjs-tailwind-resolve-dependency-tree/

While setting up a new [Next.js](https://flaviocopes.com/nextjs/) project with Tailwind I ran into an issue.

This issue might just be a temporary issue due to configuration problems and libraries versions, but I'm writing this in case someone stumbles on it.

I ran:

```
npm install tailwindcss postcss-preset-env postcss-flexbugs-fixes
```

![Terminal showing npm ERESOLVE errors with PostCSS dependency conflicts when installing Tailwind packages](https://flaviocopes.com/images/nextjs-tailwind-resolve-dependency-tree/Screen_Shot_2021-04-15_at_11.55.16.jpg)

In other words, PostCSS 8.1.13 was required but Next installed 8.1.7.

So I ran

```
npm install tailwindcss@latest postcss@latest
postcss-preset-env postcss-flexbugs-fixes
```

and it worked!
