79647377

Date: 2025-06-01 09:30:08
Score: 1
Natty:
Report link

npx tailwindcss init -p fails because Tailwind v4 moved the CLI out of the main package.

You have two options:

  1. (Recommended ⭐️) Install @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";
  1. (Not recommended 🤷) Pin to 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.

Reasons:
  • Blacklisted phrase (0.5): Why?
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: t4dhg