You’ve probably run `npx tailwindcss init` only to hit a “command not found” error, and it’s likely not your fault. Tailwind v4 changed how the CLI works, and that familiar command no longer exists by default. You can still get up and running, but the fix depends on whether you want to embrace the new setup or stick with what used to work. The solution isn’t obvious—yet it’s simpler than you might think.
Why Npx Tailwindcss Init Fails in Tailwind V4

Since Tailwind CSS v4, the `npx tailwindcss init` command no longer works because the CLI has been split from the main package. You’ll get a “could not determine executable to run” error since the binary isn’t included anymore. The initialization process changed—running this CLI command won’t create the Tailwind configuration file automatically. Instead, you must manually create it or use `npx @tailwindcss/cli`. If you depend on the old workflow, downgrading to Tailwind CSS v3 restores the original functionality. But staying current means adapting to the new structure. Avoid outdated methods and embrace the updated process for better long-term results.
Fix ‘Command Not Found’ With @Tailwindcss/Cli

If you’re seeing a “command not found” error when running `npx tailwindcss init`, it’s because the CLI was removed from the core Tailwind CSS package in v4. To fix this, install the standalone CLI by running `npm install -D @tailwindcss/cli`. This gives you access to the required binary. Then, use `npx @tailwindcss/cli init` to initialize Tailwind CSS and generate your `tailwind.config.js` file. Make sure your project directory has a valid `package.json`. If you skip `install -D @tailwindcss/cli`, you’ll keep hitting the same command not found error. Also, avoid special characters in folder names. While `npm install -D tailwindcss` is still needed, it won’t support `npx tailwindcss init` anymore.
Downgrade to Tailwind V3 for Npx Init Support

Though Tailwind CSS v4 removes built-in CLI support, you can bring back the familiar `npx tailwindcss init` command by downgrading to version 3. This simple downgrade restores full CLI functionality and smooth installation:
- Run `npm install -D tailwindcss@3 postcss autoprefixer` to lock in version 3
- The `tailwindcss` npm package in version 3 includes an executable binary
- Use `npx tailwindcss init` immediately after installation—no extra steps
- Users report fewer “command not found” errors, making the init process reliable
You regain a working CLI without managing external tools, keeping your setup clean and the executable easily accessible through npx.
Manually Create Tailwind.Config.Js for V4

When Tailwind CSS v4 drops the built-in `npx tailwindcss init` command, you’ll need to create the config file yourself—just make a new `tailwind.config.js` in your project’s root. You can’t use `npx tailwindcss init` anymore, so you must manually create the file. Start with an empty `module.exports = {}` structure, then expand it using available configuration options. Refer to the official Tailwind CSS documentation for guidance on customizing settings. Once done, make sure to include necessary Tailwind directives in your CSS files. This step is essential for Tailwind CSS version 4 to work properly. Your setup won’t function without them.
Verify Node.Js, Npm, and Project Setup First

Before you create the config file manually, confirm your environment supports it. You need Node.js and npm installed—check with `node -v` and `npm -v`. Make sure you’re in the right project directory so commands run properly. Your project must have a `package.json` to manage dependencies.
- Run `npm install -D tailwindcss` to install Tailwind CSS
- Confirm Tailwind CSS appears in your `package.json` under devDependencies
- Verify `package.json` exists—if missing, run `npm init`
- Reinstall dependencies if needed: delete `node_modules` and `package-lock.json`, then `npm install`
Without these, npx won’t work, and Tailwind CSS won’t initialize.
Fix Npx Issues Using Yarn or Pnpm

If npx tailwindcss init isn’t working, try switching to yarn or pnpm—they often handle dependencies more reliably than npm. Use yarn to install Tailwind with `yarn add -D tailwindcss postcss autoprefixer` for a smoother setup and fewer dependency issues. Or, use pnpm with `pnpm add -D tailwindcss postcss autoprefixer` to better manage your node modules. Both tools improve how the executable to run is resolved, reducing path-related errors. Unlike npm, yarn and pnpm offer consistent installations, helping avoid broken PostCSS setups. Make sure your project’s config matches your package manager, since commands vary slightly. Switching from npx tailwindcss init to yarn or pnpm could be the fix you need.
Frequently Asked Questions
Can I Use Npx Tailwindcss Init Globally?
No, you can’t use npx tailwindcss init globally. It’s designed for local projects. Run it inside your project folder so it creates tailwind.config.js properly. You’ll get errors if you try using it globally, and it won’t set up your project right. Stick to local use.
Why Does Tailwindcss Init Hang Indefinitely?
you’re probably hitting a network timeout or slow npm registry; check your internet, clear the npm cache, or try using a different registry like yarn. it’s not Tailwind—it’s likely your connection struggling to reach the package source.
Is Npm Required for Npx to Work?
Yes, you need npm for npx to work—npx comes with npm, so if npm isn’t installed, npx won’t run. Install Node.js to get both, then you can use npx to execute packages like Tailwind CSS without issues.
How Do I Uninstall Tailwind CSS Completely?
You uninstall Tailwind CSS completely by running `npm uninstall tailwindcss postcss autoprefixer` in your project. Then, delete the `tailwind.config.js` file and remove any Tailwind `@import` or `@apply` statements from your CSS files.
Does Npx Require Internet Every Time?
You don’t always need internet with npx—it checks locally first. If the package is cached or installed, it runs offline. But for first-time use or updates, yeah, you’ll need a connection to download the required files.











