dirkolbrich / hugo-tailwindcss-starter-theme

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

Cloudflare Pages build error "npx" not found #51

Closed justinbaum closed 1 year ago

justinbaum commented 1 year ago

Hello, I've got the theme working locally and I'm trying to deploy the site on Cloudflare Pages but I'm receiving the following error:

Error: error building site: POSTCSS: failed to transform "css/styles.css" (text/css). Check your PostCSS installation; install with "npm install postcss-cli". See https://gohugo.io/hugo-pipes/postcss/: binary with name "npx" not found

I've found another instance of this error in forums but it seems the underlying issue is unclear. #9730

It looks like any errors with the npx call get handled as if postcss is not supported.

I'm out of my depth here, apologies if the issue wasn't articulated clearly. Any ideas? I've set environment variables to make sure the correct version of Hugo is being used. I've got other Hugo sites deploying fine on CFP, but they are not using postcss.

justinbaum commented 1 year ago

I needed to add npm ci to my build command in cloudlfare pages.

dirkolbrich commented 1 year ago

Hey, good to see you found a solution. I couldn't have helped you anyways. There is a myriad of cloud providers out there, each with a slightly different configuration. So I stopped looking into any build issues on cloud providers. I'm just making sure this package builds locally.