tailwindcss: Can't run local installation of tailwind on windows with npx
This is very strange, perhaps an npx issue
npm i -D tailwindcss
nodemodules\.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
.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 17 (4 by maintainers)
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!
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
totailwind.config.js
!Windows Script Host Expected identifier, string or number Microsoft JScript compilation error
Yes, I have the same issue.
As per @kevindqc I will leave this here because this also helped me with the “Microsoft JScript runtime error” alert dialog appearing
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 powershellGive him a medal ❤️