0

I keep getting the error below when trying to install Tailwind with Vue.js:

Syntax Error: Error: PostCSS plugin tailwindcss requires PostCSS 8.

I've tried several answers from Error: PostCSS plugin tailwindcss requires PostCSS 8, including:

npm uninstall tailwindcss postcss autoprefixer
vue add tailwind 

And

npm uninstall tailwindcss postcss autoprefixer
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest

But nothing works. My package.json includes:

"dependencies": {
  "postcss": "^8.4.20",
  "tailwindcss": "^3"
},
"devDependencies": {
  "@vue/cli-service": "~4.5.11",
  "postcss-cli": "^8.0.0",
  "sass": "^1.56.2",
  "sass-loader": "^10.4.1",
  "vue-cli-plugin-tailwind": "~3.0.0"
}

I use Node 14.5.0.

Any suggestion as to how to solve this issue?

drake035
  • 3,955
  • 41
  • 119
  • 229

1 Answers1

1

You may have to update the @vue/cli and all its plugins to the newest version (5.0.0-rc.1), maybe the versions you have installed use PostCSS 7.

Charles Kasasira
  • 240
  • 1
  • 5
  • 15
  • 1
    I installed vue CLI 5 and the problem was still there. However, from there I uninstall Tailwind and reinstalled it, and this time it worked. Something weird going on with Tailwind I think. Anyway thanks a lot! – drake035 Dec 14 '22 at 17:21