Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: "Please install PostCSS 8 or above"

I get an error that says "Please install PostCSS 8 or above":

> [email protected] start C:\WebDevelopment\REACT\react-tailwindcss
> npm run watch:css & react-scripts start

> [email protected] watch:css C:\WebDevelopment\REACT\react-tailwindcss
> postcss src/assets/tailwind.css -o src/assets/main.css

Please install PostCSS 8 or above
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch:css: `postcss src/assets/tailwind.css -o src/assets/main.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch:css script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!    C:\Users\Rakibur Rahman\AppData\Roaming\npm-cache\_logs\2021-06-08T18_28_34_923Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `npm run watch:css && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!    C:\Users\Rakibur Rahman\AppData\Roaming\npm-cache\_logs\2021-06-08T18_28_34_958Z-debug.log

How can I solve this issue? I tried to change the version of autoprefixer to 9.8.6, but it didn't work.

Here is my package.json:

{
  "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"
  }
}
like image 328
Rakibur Rahman Avatar asked Oct 22 '25 16:10

Rakibur Rahman


1 Answers

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
like image 194
Nick Avatar answered Oct 25 '25 08:10

Nick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!