-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Unable to Run npx tailwindcss init -p - "Could Not Determine Executable to Run" #15820
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 56 -
❤️ 10 -
👀 4
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
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 427 -
😄 43 -
🎉 70 -
😕 5 -
❤️ 134 -
🚀 46
-
thank you it worked for me
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks a lot brother
Beta Was this translation helpful? Give feedback.
All reactions
-
Great, thank you...!
You save my life hehe...
Beta Was this translation helpful? Give feedback.
All reactions
-
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
It is because tailwind documentation has changed, Please install tailwind with the new guidelines
Beta Was this translation helpful? Give feedback.
All reactions
-
Really helful
Beta Was this translation helpful? Give feedback.
All reactions
-
😄 1
-
thanks !
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks it was helpful
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks Bro I just waste my 1 Hour to find the alternative.
Beta Was this translation helpful? Give feedback.
All reactions
-
But what happened to the tailwind.config.js?
Normally the init command created that file.
Beta Was this translation helpful? Give feedback.
All reactions
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 17
-
So for someone who needs to implement shadcn components,they need to use tailwind v3 right?Since shadcn requires the tailwind.config.js.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 3
-
You can still load a v3 config in v4 via the @config
directive.
Beta Was this translation helpful? Give feedback.
All reactions
-
@jishnupn04 yes bro I am also facing this problem did you got any solution ??
Beta Was this translation helpful? Give feedback.
All reactions
-
Very very thank you to KaiZenSpace bro, after 3 working days finally i got it....
Beta Was this translation helpful? Give feedback.
All reactions
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
😕 1
-
to use tailwindcss outside a npm project
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
i am unable integrate the tailwind V4 by following the steps in the documentation. Here's what am getting
{C51F0455-AAF4-4C84-AEE4-8F0186698C51}
Beta Was this translation helpful? Give feedback.
All reactions
-
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
Beta Was this translation helpful? Give feedback.
All reactions
-
A friend of mine told me to install the latest visual c++ redistributable which solved my error.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 3
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
thank you bro
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
Here's react+ts+vite+taildwind guid if someone needs
https://www.youtube.com/watch?v=WqVM0W2Hb5A&ab_channel=NickGatzoulis
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2
-
works like a bloom. TY
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks a lot dude! wasted 1 hour trying to resolve the issue
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
still giving in ...thanks
Beta Was this translation helpful? Give feedback.
All reactions
-
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
butnpx @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
- Get started with Tailwind CSS - TailwindCSS v4 Docs
- TailwindCSS v4 Alpha: Using the 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:
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";
- Using a JavaScript config file - TailwindCSS v4 Update Guide
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.
Related
Beta Was this translation helpful? Give feedback.
All reactions
-
image
the error was that :- we have to copy the command the once :- $ npm install -D tailwindcss@3 postcss autoprefixer
$ npx tailwindcss init -p
Beta Was this translation helpful? Give feedback.
All reactions
-
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:
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
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:
Beta Was this translation helpful? Give feedback.
All reactions
-
watch this video to fix that issue https://youtu.be/qDmAy6l_R6Q?si=mzgZZ_z9Dl6byZjb
Beta Was this translation helpful? Give feedback.
All reactions
-
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...
Beta Was this translation helpful? Give feedback.
All reactions
-
Generally, you shouldn't need a config file - config is done on CSS now.
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 2
-
Thanks , Great Knowledge transfer
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1