Seems like postcss is trying to load the plugins from the directory that i am running hugo, so i cannot run hugo from a different directory with the --source
flag. Tried with version 0.75 and latest. Also I am using the docsy theme GitHub - google/docsy: A set of Hugo doc templates for launching open source content.
hugo -s site
Start building sites …
hugo v0.87.0-B0C541E4+extended linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
Error: Error building site: POSTCSS: failed to transform "scss/main.css" (text/css): Error: Loading PostCSS Plugin failed: Cannot find module 'autoprefixer'
Require stack:
- /root/.docs/noop.js
(@/root/.docs/site/postcss.config.js)
at load (/root/.docs/site/node_modules/postcss-load-config/src/plugins.js:28:11)
at /root/.docs/site/node_modules/postcss-load-config/src/plugins.js:53:16
at Array.map (<anonymous>)
at plugins (/root/.docs/site/node_modules/postcss-load-config/src/plugins.js:52:8)
at processResult (/root/.docs/site/node_modules/postcss-load-config/src/index.js:37:14)
at /root/.docs/site/node_modules/postcss-load-config/src/index.js:151:14
at async Promise.all (index 0)