# PostCSS does not work in directories with spaces

**URL:** <https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101>\
**Category:** support\
**Created:** [June 14, 2022, 8:19pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101 "2022-06-14T20:19:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://discourse.gohugo.io/u/tut)\
**Post date:** [June 14, 2022, 8:19pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/1 "2022-06-14T20:19:53Z")

</div>

Used [this guide](https://www.tzeyiing.com/posts/adding-postcss-to-a-hugo-static-site/) to install and test postCSS but I get this error

```auto
$ hugo serve
Start building sites …
hugo v0.100.0-27b077544d8efeb85867cb4cfb941747d104f765+extended windows/amd64 BuildDate=xxxx VendorInfo=gohugoio
Error: Error building site: POSTCSS: failed to transform "css/root.css" (text/css): 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Built in 1448 ms

```

If it matters, I store and run Hugo in `C:\Users\user\Documents`. The `postcss.config.js` file looks like this

```auto
module.exports = {
     plugins: [
      require("autoprefixer")({
            browsers: [
                "> 1%",
                "last 2 versions"
            ]
        })
     ]
}

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 14, 2022, 9:28pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/2 "2022-06-14T21:28:43Z")

</div>

What is the complete path to your project directory?

---

<div class="post-metadata">

**Author:** ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://discourse.gohugo.io/u/tut)\
**Post date:** [June 15, 2022, 8:40am UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/3 "2022-06-15T08:40:51Z")

</div>

`C:\Users\user-name\Documents\projects\hugo-project-1` (projects houses my all sites, test sites and the Hugo binary.) `node_modules, package-lock.json, package.json, and postcss.config.js` are in the root of the `hugo-project-1`. I have `Node.js` installed too.

(I only want to add vendor prefixes to my CSS using postCSS )

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 15, 2022, 6:30pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/4 "2022-06-15T18:30:38Z")

</div>

> [@tut](#):
>
> C:\Users\user-name\Documents\projects\hugo-project-1

This is not the complete path to your project directory.

What is the value of `user-name`? Does it contain a space?  
What is the value of `hugo-project-1`? Does it contain a space?

---

<div class="post-metadata">

**Author:** ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://discourse.gohugo.io/u/tut)\
**Post date:** [June 16, 2022, 8:04am UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/5 "2022-06-16T08:04:49Z")

</div>

> [@jmooring](#):
>
> What is the value of `user-name`? Does it contain a space?

This was the problem. Solved by removing the spaces.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 16, 2022, 4:10pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/6 "2022-06-16T16:10:11Z")

</div>

[https://github.com/gohugoio/hugo/issues/7333](https://github.com/gohugoio/hugo/issues/7333)

---

<div class="post-metadata">

**Author:** ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://discourse.gohugo.io/u/tut)\
**Post date:** [June 16, 2022, 4:53pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/7 "2022-06-16T16:53:39Z")

</div>

So it is a known issue…I had to create a new user account and copy paste the files from the old user to the new user (since renaming the user in the registry corrupted the account). I hope some progress will come out of this.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 16, 2022, 4:57pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/8 "2022-06-16T16:57:55Z")

</div>

See this comment for a workaround:  
[https://github.com/gohugoio/hugo/issues/7333#issuecomment-1048571703](https://github.com/gohugoio/hugo/issues/7333#issuecomment-1048571703)

---

<div class="post-metadata">

**Author:** ![tut](https://avatars.discourse-cdn.com/v4/letter/t/e95f7d/32.png) [@tut](https://discourse.gohugo.io/u/tut)\
**Post date:** [June 16, 2022, 7:06pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/9 "2022-06-16T19:06:11Z")

</div>

Thanks. I will mark that in case this happens again.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [June 18, 2022, 7:07pm UTC](https://discourse.gohugo.io/t/postcss-does-not-work-in-directories-with-spaces/39101/10 "2022-06-18T19:07:08Z")

</div>

Closed on June 18, 2022, 7:07pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
