apvarun / showfolio-hugo-theme

Modern portfolio theme for your Hugo site
https://showfolio.vercel.app/
MIT License
102 stars 41 forks source link

Failing to build website #11

Closed wisewtf closed 2 years ago

wisewtf commented 2 years ago

Hello.

Trying to use this theme for a Hugo website. It's failing to build even the sample website.

 hugo serve --themesDir ../..
Start building sites …
hugo v0.87.0-B0C541E4 linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio
Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): Error: Cannot find module '@fullhuman/postcss-purgecss'
Require stack:
- /var/www/html/artist-dev/themes/showfolio/assets/css/postcss.config.js
- /usr/lib/node_modules/postcss-cli/node_modules/lilconfig/dist/index.js
- /usr/lib/node_modules/postcss-cli/node_modules/postcss-load-config/src/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/var/www/html/artist-dev/themes/showfolio/assets/css/postcss.config.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/var/www/html/artist-dev/themes/showfolio/assets/css/postcss.config.js',
    '/usr/lib/node_modules/postcss-cli/node_modules/lilconfig/dist/index.js',
    '/usr/lib/node_modules/postcss-cli/node_modules/postcss-load-config/src/index.js'
  ]
}
Built in 388 ms

I did install npm install -g postcss-cli

I tried on both an RPi4 and an x86-64 Ubuntu 20.04 server. What should I do?

hugo v0.87.0-B0C541E4 linux/amd64 BuildDate=2021-08-03T10:57:28Z VendorInfo=gohugoio

apvarun commented 2 years ago

Hi @wisewtf ,

From the above log, I believe artist-dev is your hugo site

In order to run the exampleSite, you need to navigate to themes/showfolio folder and run npm install before running hugo serve --themesDir ../.. inside the exampleSite folder

And if you are setting it up for your site, please copy the package.json and package-lock.json to your artist-dev folder, run npm install and then start hugo server

Let me know if this helps