This is very strange, perhaps an npx issue
npm i -D tailwindcssnodemodules\.bin\tailwind produces usage message as expectednpx tailwind errors 
I've no idea why windows scripthost is being run and not nodejs. Must be somehting in your config on windows?
The error is a trailing , in your object literals, no doubt as scripthost is a crappy old version of JS.
This doesn't happen with other things I tried in .bin like rimraf. There's no obvious difference between the scripts or cmd files though, I think these are created for the package anyway.
PS the usage message show cli which I think should be tailwind.
Shouldn't the command be npx tailwind not npm tailwind?
Of course it should!. Sorry. I've corrected the report.
Alright just wanted to make sure that wasn't the problem! I haven't used Windows in years and don't have any great way to test this :/
The usage message just shows the name of the file, which happens to be cli.js in the repo but is aliased to tailwind when exported to the .bin directory, so if it's running properly from that directory it reports the right name.
It seems like npx tailwind is maybe trying to run your local tailwind.js config file as if it was a script instead of running the actual Tailwind CLI?
What happens if you rename your tailwind.js file to something completely different like foo.js and then try npx tailwind again?
I checked on my Windows machine, and as long as the tailwind config file is named tailwind.js, mine errors out. A dialog box doens't show up like that, but it does appear that npx is trying to run the config file. If I rename my config file to tailwind-config.js it works perfectly. I hope that helps!
Thanks for exploring this! Seems you made a good call I'll try it. So on WIndow's npx tries to run .js files! not just those set in the PATHEXT env var (I think that makes sense). I'll raise it upstream.
Would you like a pull request for the README?
Works fine when I use another file name.
.tailwindrctailwind init foo the file created is foo.js not fooWe could change the default file name, probably to something like tailwind.config.js.
Adding the .js extension automatically was actually a recent pull request by a community member; we didn't used to do it but figured it makes sense since it's a JS file.
Going to close this as resolved since it seems to be a problem (or maybe a feature?) of npx.
tailwind.config.js
+1
figured it makes sense since it's a JS file.
Hmm, I think you should honour what the user specified. Principle of least
surprises. Though I do agree it makes sense is js for code highlighting and
actual contents.
Anyway it's what it is :)
It seems like
npx tailwindis maybe trying to run your localtailwind.jsconfig file as if it was a script instead of running the actual Tailwind CLI?
Yes, I have the same issue.
just replace the tailwind.js file to tailwind.config.js and run the tailwind cli command npx tailwind build src/css/tailwind.src.css -c tailwind.config.js -o src/css/tailwind.css , file will be compiled. If windows command line wont compile the file just use powershell
I checked on my Windows machine, and as long as the tailwind config file is named tailwind.js, mine errors out. A dialog box doens't show up like that, but it does appear that npx is trying to run the config file. If I rename my config file to tailwind-config.js it works perfectly. I hope that helps!
I don't know why but it works. Thank you!
Don't mind me, just adding some keywords for google for the next person, since it's in an image! Took me a bit to find this! Solution: Just rename to tailwind.js to tailwind.config.js!
Windows Script Host Expected identifier, string or number Microsoft JScript compilation error
As per @kevindqc I will leave this here because this also helped me with the "Microsoft JScript runtime error" alert dialog appearing
Don't mind me, just adding some keywords for google for the next person, since it's in an image! Took me a bit to find this! Solution: Just rename to
tailwind.jstotailwind.config.js!Windows Script Host Expected identifier, string or number Microsoft JScript compilation error
Thank you, This worked, I am just not able to figure out how it worked.. Can you explain ?
can you explain.
My guess is js script host makes simplistic assumption that anything after first . Char is the extension so doesn't see .js and so doesn't get excited about the file.
Most helpful comment
I checked on my Windows machine, and as long as the tailwind config file is named tailwind.js, mine errors out. A dialog box doens't show up like that, but it does appear that npx is trying to run the config file. If I rename my config file to tailwind-config.js it works perfectly. I hope that helps!