I’m just getting started with Hugo, and I’m in the process of trying to get CSS styling setup using Tailwind. I think I’ve encountered a hugo bug that’s specific to Windows, but ultimately I don’t know what the issue is.
I can link to a repo, but I don’t think it would help. This is more or less a bare repo that follows the directions in the documentation for css.TailwindCSS. Just a site created with hugo new site and then initialized (technically I also created a new theme inside with hugo new theme).
Installing in the base directory using npm, creating the files as directed, and then running hugo build
hugo build --logLevel debug
Start building sites …
hugo v0.151.1-1cdd17882c28a9f23278d38ef03b403954cfb1e5 windows/amd64 BuildDate=2025-10-15T14:51:34Z VendorInfo=gohugoio
INFO build: step process substep collect files 7 files_total 7 pages_total 6 resources_total 1 duration 999.8µs
INFO build: step process duration 999.8µs
INFO build: step assemble duration 500.2µs
INFO build: step render substep pages site en outputFormat html duration 6.5104ms
INFO build: step render substep pages site en outputFormat rss duration 999.2µs
INFO build: step render pages 18 content 10 duration 8.0086ms
INFO static: syncing static files to \ duration 17.5092ms
INFO exec: resolve "tailwindcss" using npx
INFO tailwindcss: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
INFO build: step render deferred count 10 duration 25.0638ms
INFO build: step postProcess duration 0s
INFO build: duration 36.0091ms
Total in 47 ms
Error: error building site: TAILWINDCSS: failed to transform "/css/main.css" (text/css): 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
It looks to me like Hugo is trying to find tailwindcss in the PATH environment variables, but then running it without quotes? Then erroring out because one of the paths in my PATH environment variable is C:\Program Files...
I’m running Windows 11, Hugo installed via chocolatey.
hugo v0.151.1-1cdd17882c28a9f23278d38ef03b403954cfb1e5 windows/amd64 BuildDate=2025-10-15T14:51:34Z VendorInfo=gohugoio
node v22.20.0
npm 11.6.2
I’d try to switch to hugo in WSL… but then I run into a different issue with it that seems to be a bug in @parcel/watcher and not hugo related.
In the same directory, if I run npx tailwindcss, it will run just fine:
npx tailwindcss
≈ tailwindcss v4.1.14
Usage:
tailwindcss [--input input.css] [--output output.css] [--watch] [options…]
Options:
-i, --input ················· Input file
-o, --output ················ Output file [default: `-`]
-w, --watch[=always] ········ Watch for changes and rebuild as needed, and use `always` to keep watching when stdin is closed
-m, --minify ················ Optimize and minify the output
--optimize ·············· Optimize the output without minifying
--cwd ··················· The current working directory [default: `.`]
--map ··················· Generate a source map [default: `false`]
-h, --help ·················· Display usage information
Any help would be much appreciated.