Error: Please install PostCSS 8 or above. how can I fix this?

7.4k Views Asked by At

Here is my package.json file.how can I solve this issue?. I tried to change the version of autoprefixer to 9.8.6 but it didn't work. Please help me with this issue

{
  "name": "react-tailwindcss",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
  "@testing-library/jest-dom": "^5.13.0",
  "@testing-library/react": "^11.2.7",
  "@testing-library/user-event": "^12.8.3",
  "react": "^17.0.2",
  "react-dom": "^17.0.2",
  "react-scripts": "4.0.3",
  "web-vitals": "^1.1.2"
},
 "scripts": {
 "start": "npm run watch:css && react-scripts start",
 "build": "npm run build:css && react-scripts build",
 "test": "react-scripts test",
 "eject": "react-scripts eject",
 "build:css": "postcss src/assets/tailwind.css -o src/assets/main.css",
 "watch:css": "postcss src/assets/tailwind.css -o src/assets/main.css"
},
 "eslintConfig": {
 "extends": [
  "react-app",
  "react-app/jest"
 ]
},
 "browserslist": {
 "production": [
  ">0.2%",
  "not dead",
  "not op_mini all"
],
 "development": [
  "last 1 chrome version",
  "last 1 firefox version",
  "last 1 safari version"
 ]
},
 "devDependencies": {
 "autoprefixer": "^9.8.6",
 "postcss-cli": "^8.3.1",
 "tailwindcss": "^2.1.4"
 }
}

Here is the dependency file that I installed. and It shows me Pleaseenter image description here install PostCSS 8 or above

1

There are 1 best solutions below

0
On

It looks like you have postcss-cli installed, but TailwindCSS needs postcss. You just need to install it. Here's the terminal commands for all major package managers.

npm

npm i -D postcss@latest

yarn

yarn add -D postcss@latest

pnpm

pnpm i -D postcss@latest