I'm trying to set up Shadcn UI in a new React.js project using Vite with JavaScript, but I'm encountering some issues.
Steps Taken for Shadcn UI:
Created a new React.js project with Vite and selected JavaScript:
npm create vite@latest my-projectRan the following command to install Tailwind CSS dependencies:
npm install -D tailwindcss postcss autoprefixer
However, the tailwind.config.js and postcss.config.js files were not generated automatically.
- As per the Shadcn UI docs, I ran:
npx tailwindcss init
But I encountered the following error:
npm ERR! could not determine executable to run
I also tried installing Tailwind CSS v3 using the official Tailwind CSS docs for Vite, but faced a similar issue. Here's what I did:
Ran the command:
npm install -D tailwindcss postcss autoprefixer
But again, the tailwind.config.js and postcss.config.js files were not generated as expected.
Ran the next command as instructed:
npx tailwindcss init
And encountered the same error:
npm ERR! could not determine executable to run.
Questions:
Why aren’t the tailwind.config.js and postcss.config.js files being generated automatically when running the installation commands?
How can I resolve the error
npm ERR! could not determine executable to runwhen initializing Tailwind CSS or Shadcn UI?Is there a specific configuration or prerequisite I might be missing for setting up Shadcn UI in a React.js (Vite + JavaScript) project?
shadcn-ui/ui#6427 and Shadcn UI with TailwindCSS v4