Skip to content
nkNilay Kabariya

Entry No.007·Fixes··2 min read

Fix: npx tailwindcss init “could not determine executable to run”

Tailwind CSS v4 removed the init command, so npx has nothing to run. Two fixes, both reproduced: set up v4 without a config file, or pin v3.

by Nilay#tailwind#npm#cssFIXED

The error, verbatim

Jump to the fix ↓
$ npx tailwindcss init
npm error could not determine executable to run
npm error A complete log of this run can be found in: ...\npm-cache\_logs\...-debug-0.log

Tested on

tailwindcss
4.3.3 (and 3.4.19)
CLI
@tailwindcss/cli 4.3.3
Node / npm
24.14.0 / 11.9.0
OS
Windows 11 Pro
Contents
  1. The fix01
  2. Why it happens02
  3. Already have a tailwind.config.js?03
  4. What didn’t work04

The fix

npm i tailwindcss now installs Tailwind CSS v4, and v4 has no init command. It doesn’t use a tailwind.config.js by default either. That’s why npx finds nothing to run: the tailwindcss package no longer ships a command-line tool at all.

Pick the fix that matches what you want.

Skip init. Install the CLI package, then point it at a CSS file that imports Tailwind:

npm install -D tailwindcss @tailwindcss/cli
/* src/input.css */
@import "tailwindcss";
npx @tailwindcss/cli -i ./src/input.css -o ./dist/output.css --watch

That’s the whole setup. There’s no config file and no content array, because v4 finds your class names on its own.

If you use Vite, Next.js or another framework, use its plugin instead of the CLI (@tailwindcss/vite, or @tailwindcss/postcss for PostCSS setups). The CSS file is the same.

Option 2: stay on v3 because a tutorial or template expects it

Pin the old major version and init works again:

npm install -D tailwindcss@3
npx tailwindcss init

Why it happens

Before v4, the tailwindcss package included a CLI, so npx tailwindcss init ran it and created tailwind.config.js. In v4 the CLI moved to its own package, @tailwindcss/cli, and configuration moved into your CSS using @theme. In the installed v4 package there’s no executable at all, not even a node_modules/.bin folder, so npm can’t work out what to run.

Most tutorials and courses were written for v3. That’s why so many people hit this on their very first command.

Already have a tailwind.config.js?

v4 ignores it unless you point to it. In my test, a custom brand colour from the config produced no text-brand class until I added one line to the CSS:

@import "tailwindcss";
@config "../tailwind.config.js";

After that, .text-brand { color: #c8410f; } appeared in the output. It’s a good bridge while you move settings into @theme.

What didn’t work

— N.K., end of entry No.007

Useful? Pass it on:Post on X

Related entries

  1. No.009

    Fix: “trying to use tailwindcss directly as a PostCSS plugin”

    Tailwind CSS v4 moved its PostCSS plugin to a separate package. The two-line change to postcss.config.js, reproduced and verified.

    > Error: It looks like you're trying to use `tailwindcss` directly as a PostCSS

    FIXED1 min
  2. No.008

    Fix: “Cannot apply unknown utility class” in Tailwind CSS v4

    Two causes trigger this Tailwind v4 error: an unmapped theme variable (border-border) or a CSS file missing @reference. Both reproduced and fixed.

    > Error: Cannot apply unknown utility class `border-border`

    FIXED1 min
  3. No.006

    Fix: npm ERESOLVE unable to resolve dependency tree (React 19)

    npm refuses to install a package whose peer range doesn't include your React version. Four fixes compared, and why --legacy-peer-deps alone breaks later.

    > npm error code ERESOLVE

    FIXED1 min

Post card · Newsletter

Get the next fix in your inbox.

One short email when a new entry is published. No spam, never shared, and you can leave any time.

— Nilay

or follow by RSS

By subscribing you agree to the privacy note. One click to leave.

tip: paste the exact error text