apvarun / showfolio-hugo-theme

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

Running the example, we get Error building site: POSTCSS: failed to transform "css/styles.css" #10

Closed huogerac closed 2 years ago

huogerac commented 3 years ago

Hi, great theme, however, I couldn't run it

hugo serve --themesDir ../..
Start building sites … 
hugo v0.88.1-5BC54738 linux/amd64 BuildDate=2021-09-04T09:39:19Z VendorInfo=gohugoio
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/
Built in 594 ms

I've tried to install the postcss-cli: npm install -g npm install postcss-cli

then another error pops up:

hugo serve --themesDir ../..          
Start building sites … 
hugo v0.88.1-5BC54738 linux/amd64 BuildDate=2021-09-04T09:39:19Z VendorInfo=gohugoio
Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'postcss' imported from /home/roger/.nvm/versions/node/v14.17.6/lib/node_modules/postcss-cli/index.js
    at packageResolve (internal/modules/esm/resolve.js:664:9)
    at moduleResolve (internal/modules/esm/resolve.js:705:18)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:819:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:73:40)
    at link (internal/modules/esm/module_job.js:72:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
Built in 95 ms

Anyone have some tip? Sorry! I'm new in go and hugo...

cheers!

obs: I've installed the latest hugo version (v0.88.1) using .deb package on ubuntu LTS

apvarun commented 3 years ago

@huogerac Can you confirm if you have executed this command? npm install -g postcss-cli

The command you shared seem to be wrong. Above command is what you need to execute before hugo serve

entsalze commented 2 years ago

@huogerac Can you confirm if you have executed this command? npm install -g postcss-cli

The command you shared seem to be wrong. Above command is what you need to execute before hugo serve

Hi, I also have this problem. I built with hugo v0.89.4. The error feedback is as follows:

Error: Error building site: POSTCSS: failed to transform "css/styles.css" (text/css): /usr/local/lib/node_modules/postcss-cli/index.js:3
import fs from 'fs-extra'
       ^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Built in 30124 ms
mateuszbialowas commented 2 years ago

I run npm install -g postcss-cli then npm update And now it is working. Thank you

apvarun commented 2 years ago

@imsalze Looks like you have not executed npm install locally

The steps are as follows: