(Tailwind in React) npm run start not working

22 views Asked by At

I recently started learning Tailwind. I installed tailwind step by step as tailwind website said. After that when I write on VSCode Terminal npm run start.

How to solve this? Shows some error. What should I do next step to solve this?

1

There are 1 answers

0
Seyed Saleh Mirbagheri On

you can create react project with tailwind from strart like this:

  1. npm create vite@latest my-project -- --template react
  2. cd my-project
  3. npm install
  4. npm install -D tailwindcss postcss autoprefixer
  5. npx tailwindcss init -p
  6. go in tailwind.config.js ==> in content section ==> write like this : content: ["./index.html", "./src/**/*.{js,jsx,ts,tsx}"]
  7. go in index.css file and delete all codes there and write these: @tailwind base; @tailwind components; @tailwind utilities;
  8. npm run dev