dirkolbrich / hugo-tailwindcss-starter-theme

Starter files for a Hugo theme with Tailwindcss
MIT License
400 stars 55 forks source link

Error: Cannot find module 'postcss' #32

Closed joebudi closed 3 years ago

joebudi commented 3 years ago

I followed your instructions in the readme step by step, but I am getting the following error, when I run the following command: hugo server -s exampleSite --themesDir=../.. --disableFastRender

Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): internal/modules/cjs/loader.js:969 throw err; ^

Error: Cannot find module 'postcss' Require stack:

I have installed the prerequisites.

joebudi commented 3 years ago

I managed to work around it by moving my config and content folders to root, and simply running hugo serve. I am not sure if this is a workaround or a flawed sense of progress, but I am getting no errors and the site is available.

dirkolbrich commented 3 years ago

Weird, as it works on my machine™.

Can you please run the following commands from your the root of the starter repo: npm list -depth=0, npm list -depth=0 -g and hugo version

You should see:

/Users/your-user-name/some-folder/hugo-theme-tailwindcss-starter
├── @fullhuman/postcss-purgecss@4.0.2
├── @tailwindcss/typography@0.4.0
├── autoprefixer@10.2.4
├── postcss-cli@8.3.1
├── postcss-import@14.0.0
├── postcss@8.2.6
└── tailwindcss@2.0.3
npm list -depth=0 -g
/usr/local/lib
├── autoprefixer@10.2.0
├── npm-check-updates@10.2.5
├── npm@7.6.3
├── postcss-cli@8.3.1
└── postcss@8.2.3
hugo version
hugo v0.82.0+extended darwin/amd64 BuildDate=unknown