I am having an issue running hugo server -D as it cannot find the POSTCSS transform executable. I believe it is likely missing quotes around the executable path, but I am unsure where to look for the location that specifies C:\Program ... etc. Where should I look to troubleshoot this error?
Error: Error building site: POSTCSS: failed to transform “fullstyle.css” (text/css): ‘C:\Program’ is not recognized as an internal or external command,
operable program or batch file.
It’s not about POSTCSS, but about a path you are using. You are on Windows and have a folder “Program Files” somewhere. The space on the bash needs to be either backslashed (Program\ Files) or the whole path to whatever is looked for in Program Files needs to be in quotation marks. Depends on what exactly is throwing the error, so post a sample or your repo and we can have a look. Or maybe just search the whole project for “Program Files” and decide which one is the culprit Then add "C:/Program Files/bla/fase" with quotation marks instead.
I wonder if maybe a local postcss installation would solve the issue on Windows and this is happening because postcss is installed globally and as such somehow in the program files folder. I never developed on Windows though…
On many operating systems a pathname with a space (or any other non-alphanumerical character) needs escaping. Which is done by quotation marks or backslashes or by not using spaces in path names. Windows then came to the table and decided to it all better and different.
In this specific case, the Golang tool (package or module?) that takes care of paths and hands paths over to its scripts did not escape the space.