npx tailwindcss init -p
fails because Tailwind v4 moved the CLI out of the main package.
You have two options:
@tailwindcss/cli
and the command will work again or simply follow the new v4 one-liner @import "tailwindcss"
workflow, like this:npm install -D tailwindcss @tailwindcss/cli postcss autoprefixer
And then add the new @import "tailwindcss"
in the first line your main css file, like this:
/* src/styles.css — or app.css, globals.css, input.css, etc. */
@import "tailwindcss";
tailwindcss@3
and the command will work again, like this:npm install -D tailwindcss@3 postcss autoprefixer
npx tailwindcss init -p
## Why?
Starting with Tailwind CSS v4 (January 2025) the CLI that used to live inside the tailwindcss package was split out into a dedicated package called @tailwindcss/cli
.
Because the binary is no longer bundled, npx tailwindcss init -p
can’t find anything to execute and npm shows the cryptic error.