Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Unable to Run npx tailwindcss init -p - "Could Not Determine Executable to Run" #15820

Answered by wongjn
abderrahimlaribi asked this question in Help
Discussion options

I am encountering an error while trying to initialize a Tailwind CSS configuration in my project using the command:

npx tailwindcss init -p

The error message I get is:

npm ERR! could not determine executable to run
npm ERR! A complete log of this run can be found in:
C:\Users\DELL\AppData\Local\npm-cache_logs2025円-01-24T16_26_01_565Z-debug-0.log

What I've Tried:
Installed the dependencies using:
npm install -D tailwindcss postcss autoprefixer

This was successful, and I verified that they were added to devDependencies in my package.json.

Looked in the .bin directory under node_modules but couldn't find the tailwindcss executable.

Any suggestions or insights into resolving this issue would be greatly appreciated. Thank you!

You must be logged in to vote

The init command no longer exists in v4. Consider checking the installation documentation that is most relevant to your project to integrate Tailwind v4.

If you are trying to use v3, ensure the version qualifier is used:

$ npm install -D tailwindcss@3 postcss autoprefixer
$ npx tailwindcss init -p

Replies: 17 comments 164 replies

Comment options

The init command no longer exists in v4. Consider checking the installation documentation that is most relevant to your project to integrate Tailwind v4.

If you are trying to use v3, ensure the version qualifier is used:

$ npm install -D tailwindcss@3 postcss autoprefixer
$ npx tailwindcss init -p
You must be logged in to vote
145 replies
Comment options

thank you it worked for me

Comment options

thanks a lot brother

Comment options

Great, thank you...!
You save my life hehe...

Comment options

Thank you!

Comment options

The init command no longer exists in v4. Consider checking the installation documentation that is most relevant to your project to integrate Tailwind v4.

If you are trying to use v3, ensure the version qualifier is used:

$ npm install -D tailwindcss@3 postcss autoprefixer
$ npx tailwindcss init -p

Thanks, It really worked , as I have wasted so many hours to debug this issues but not able to overcome this issues. But this really worked.

Answer selected by abderrahimlaribi
Comment options

It is because tailwind documentation has changed, Please install tailwind with the new guidelines

You must be logged in to vote
4 replies
Comment options

Really helful

Comment options

thanks !

Comment options

Thanks it was helpful

Comment options

Thanks Bro I just waste my 1 Hour to find the alternative.

Comment options

But what happened to the tailwind.config.js?
Normally the init command created that file.

You must be logged in to vote
6 replies
Comment options

Yes I found this here:
https://tailwindcss.com/blog/tailwindcss-v4#css-first-configuration

_One of the biggest changes in Tailwind CSS v4.0 is the shift from configuring your project in JavaScript to configuring it in CSS.
Instead of a tailwind.config.js file, you can configure all of your customizations directly in the CSS file where you import Tailwind, giving you one less file to worry about in your project..._

Thank you!

Comment options

So for someone who needs to implement shadcn components,they need to use tailwind v3 right?Since shadcn requires the tailwind.config.js.

Comment options

wongjn Jan 27, 2025
Collaborator

You can still load a v3 config in v4 via the @config directive.

Comment options

@jishnupn04 yes bro I am also facing this problem did you got any solution ??

Comment options

Very very thank you to KaiZenSpace bro, after 3 working days finally i got it....

Comment options

for anyone trying to use tailwindcss outside a npm project, you can install globally with:

how to install and configure tailwindCSS executable?

# download tailwind binary and move to "~/.tailwindcss/bin"
mkdir ~/.tailwindcss; cd ~/.tailwindcss/
mkdir bin; cd bin
# this works for arm64, check docs for other arch
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-macos-arm64
chmod +x tailwindcss-macos-arm64
mv tailwindcss-macos-arm64 tailwindcss
  • add to your .zshrc or .bashrc:
# tailwindcss
export PATH=$PATH:~/.tailwindcss/bin

now you can use tailwindcss

tailwindcss --help
You must be logged in to vote
1 reply
Comment options

to use tailwindcss outside a npm project

Comment options

i am unable integrate the tailwind V4 by following the steps in the documentation. Here's what am getting
{C51F0455-AAF4-4C84-AEE4-8F0186698C51}

You must be logged in to vote
2 replies
Comment options

i am unable integrate the tailwind V4 by following the steps in the documentation. Here's what am getting {C51F0455-AAF4-4C84-AEE4-8F0186698C51}

Show vite.config plz

Comment options

A friend of mine told me to install the latest visual c++ redistributable which solved my error.

Comment options

What Thank you so much for your helpful answer! It saved me a lot of time and pointed me in the right direction. I was unaware that the init command no longer exists in Tailwind v4, and your advice to use the version qualifier for v3 was exactly what I needed. I really appreciate your clear explanation and the time you took to provide this solution. Thanks again!

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
Comment options

thank you bro

Comment options

Welcome vedika, are you a frontend developer ??
...
On Wed, 12 Feb, 2025, 11:40 pm VedikaGaikwad2004, ***@***.***> wrote: thany you — Reply to this email directly, view it on GitHub <#15820 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BMBQB2H5J5TMXPLIQQ3F6GT2POE77AVCNFSM6AAAAABV2B6WFCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMJXHAYDINQ> . You are receiving this because you commented.Message ID: ***@***.*** com>
You must be logged in to vote
0 replies
Comment options

Here's react+ts+vite+taildwind guid if someone needs
https://www.youtube.com/watch?v=WqVM0W2Hb5A&ab_channel=NickGatzoulis

You must be logged in to vote
1 reply
Comment options

works like a bloom. TY

Comment options

Thanks a lot dude! wasted 1 hour trying to resolve the issue

You must be logged in to vote
0 replies
Comment options

Steps are still present in the Jetbrains docs https://www.jetbrains.com/help/phpstorm/tailwind-css.html#ws_css_tailwind_install

If you see this, update your IDE to one with 2024年3月2日 (released this year) with the change from https://youtrack.jetbrains.com/issue/WEB-70442/Support-Tailwind-CSS-4

You should NOT need to run this command anymore, and get the tailwind.config.js. Just update your IDE.

You must be logged in to vote
0 replies
Comment options

still giving in ...thanks

You must be logged in to vote
0 replies
Comment options

Deprecated init process

In v4, the installation process has changed. It's now simpler. The init command has become obsolete and is no longer usable from v4 onwards because it's not needed anymore.


Source: Problem installing TailwindCSS with "npx tailwindcss init -p" command

Changed npx tailwindcss to npx @tailwindcss/cli

The command to run is now no longer npx tailwindcss but npx @tailwindcss/cli.

PostCSS plugin and CLI are separate packages — the main tailwindcss package doesn't include these anymore since not everyone needs them, instead they should be installed separately using @tailwindcss/postcss and @tailwindcss/cli.


Source: Open-sourcing our progress on Tailwind CSS v4.0 - Whats changed

This is basically only necessary if you're not using it with a framework and want to run it from the command line. For this, a standalone @tailwindcss/cli package will help from v4 onwards.

npm install tailwindcss @tailwindcss/cli

Source: Problem installing TailwindCSS with "npx tailwindcss init -p" command

CSS-first configuration

CSS-First Configuration: Customize and extend the framework directly in CSS instead of JavaScript.

With TailwindCSS v4, you have the option to omit the tailwind.config.js file. You can find many new directives, such as @theme, which allows you to declare your custom settings directly in your CSS file, or @plugin, which lets you import TailwindCSS v4-compatible plugins directly in your CSS file.

I won't list all the new directives, but you can check them out here:


Source: What's the new CSS-first configuration

TailwindCSS v4 is backwards compatible with v3

Using a JavaScript config file

JavaScript config files are still supported for backward compatibility, but they are no longer detected automatically in v4.

If you still need to use a JavaScript config file, you can load it explicitly using the @config directive:

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

The configuration setting has changed by default. However, you have the option to declare the location of your tailwind.config.js file using a relative path in your default CSS file so you can use it again.


Source: TailwindCSS v4 is backwards compatible with v3

Related

You must be logged in to vote
0 replies
Comment options

image
the error was that :- we have to copy the command the once :- $ npm install -D tailwindcss@3 postcss autoprefixer
$ npx tailwindcss init -p

You must be logged in to vote
1 reply
Comment options

Although it fixes the issue, it doesn't explain the reason. The reason is that from January 2025, running npm install tailwindcss installs v4 by default. In v4, there's no need for tailwind.config.js by default, so the init process became obsolete and was removed. In v4, there's no need to run the init process as asked in the question. More details:

Comment options

npm install -D tailwindcss@3
image
image

You must be logged in to vote
2 replies
Comment options

Although it fixes the issue, it doesn't explain the reason. The reason is that from January 2025, running npm install tailwindcss installs v4 by default. In v4, there's no need for tailwind.config.js by default, so the init process became obsolete and was removed. In v4, there's no need to run the init process as asked in the question. More details:

Comment options

watch this video to fix that issue https://youtu.be/qDmAy6l_R6Q?si=mzgZZ_z9Dl6byZjb

Comment options

I'm encountering some difficulties with the new installation flow.

In the previous version, everything was more straightforward and easy to configure...
Regardless of what I do, I couldn't achieve to get tailwind config file... I did everything according to "Nuxt" instructions for my Vue project, there's no section for VUE, (although both have the same bases so it supposed to be working..) -> https://tailwindcss.com/docs/installation/framework-guides

The doc should be more clear I found out about this change from this stack overflow post: https://stackoverflow.com/questions/79380514/problem-installing-tailwindcss-with-vite-after-npx-tailwindcss-init-p-comman/79380522#79380522

My question is: Is there a problem with the npm package? Coz I also got the same error like most people here... I think it can be improved, many people got issues, it shouldn't be that complicated or maybe because we're so used to the way it was...

You must be logged in to vote
1 reply
Comment options

wongjn Apr 10, 2025
Collaborator

Generally, you shouldn't need a config file - config is done on CSS now.

Comment options

Thanks , Great Knowledge transfer

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /