nusserstudios / tailbliss

TailBliss is a Hugo Starter theme built on TailwindCSS 3, and Alpine.JS.
https://tailbliss.netlify.app/
Apache License 2.0
314 stars 146 forks source link

module does not exist #129

Closed jesicasusanto closed 1 year ago

jesicasusanto commented 1 year ago

i got this error when running hugo server with the tailbliss theme:

Error: command error: failed to load modules: module " github.com/gohugoio/hugo-mod-jslibs-dist/alpinejs/v3 " not found in "C:\\Users\\jesic\\work\\blog\\themes\\ github.com \\gohugoio\\hugo-mod-jslibs-dist\\alpinejs\\v3"; either add it as a Hugo Module or store it in "C:\\Users\\jesic\\work\\blog\\themes".: module does not exist

Steps to reproduce :

hugo new site blog
cd blog
git init
git submodule add [GitHub - nusserstudios/tailbliss: TailBliss is a Hugo Starter theme built on TailwindCSS 3, and Alpine.JS.](https://github.com/nusserstudios/tailbliss.git) themes/tailbliss
echo “theme = ‘tailbliss’” >> hugo.toml hugo server
KhalilSecurity commented 1 year ago

I believe this repo is a frontend to Hugo, not just a theme. You don't need to execute hugo new site with this one, instead:

  1. Clone the repo
  2. cd tailbliss
  3. sudo apt install npm
  4. sudo snap install go --classic
  5. sudo npm install
  6. sudo npm run build

To test if it's working (change to your PC IP) sudo hugo server --bind 192.168.217.24 --baseURL http://192.168.217.24 Make your edits as you wish, and don't forget the config here is hugo.yaml not .toml (format of yaml is way better anyway) To generate /public to upload to your website sudo hugo --gc --minify

jesicasusanto commented 1 year ago

Thank you for your help @KhalilSecurity . it's working now

jesicasusanto commented 1 year ago

Hi @KhalilSecurity , I was trying to deploy the website on netlify but i got a failed build error : 3:22:00 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2) 3:21:59 PM: Netlify Build 3:21:59 PM: ──────────────────────────────────────────────────────────────── 3:21:59 PM: ​ 3:21:59 PM: ❯ Version 3:21:59 PM: @netlify/build 29.17.1 3:21:59 PM: ​ 3:21:59 PM: ❯ Flags 3:21:59 PM: baseRelDir: true 3:21:59 PM: buildId: 64c04ad11193bb10981e9731 3:21:59 PM: deployId: 64c04ad11193bb10981e9733 3:21:59 PM: ​ 3:21:59 PM: ❯ Current directory 3:21:59 PM: /opt/build/repo 3:21:59 PM: ​ 3:21:59 PM: ❯ Config file 3:21:59 PM: /opt/build/repo/netlify.toml 3:21:59 PM: ​ 3:21:59 PM: ❯ Context 3:21:59 PM: production 3:21:59 PM: ​ 3:21:59 PM: build.command from netlify.toml 3:21:59 PM: ──────────────────────────────────────────────────────────────── 3:21:59 PM: ​ 3:21:59 PM: $ hugo --gc --minify 3:21:59 PM: Error: Unable to locate config file or config directory. Perhaps you need to create a new site. 3:21:59 PM: Runhugo help newfor details. 3:21:59 PM: Total in 0 ms 3:21:59 PM: ​ 3:21:59 PM: build.command failed 3:21:59 PM: ──────────────────────────────────────────────────────────────── 3:21:59 PM: ​ 3:21:59 PM: Error message 3:21:59 PM: Command failed with exit code 255: hugo --gc --minify (https://ntl.fyi/exit-code-255) 3:21:59 PM: ​ 3:21:59 PM: Error location 3:21:59 PM: In build.command from netlify.toml: 3:21:59 PM: hugo --gc --minify 3:21:59 PM: ​ 3:21:59 PM: Resolved config 3:21:59 PM: build: 3:21:59 PM: command: hugo --gc --minify 3:21:59 PM: commandOrigin: config 3:21:59 PM: environment: 3:21:59 PM: - HUGO_VERSION 3:21:59 PM: - HUGO_ENV 3:21:59 PM: - HUGO_ENABLEGITINFO 3:21:59 PM: publish: /opt/build/repo/public 3:21:59 PM: publishOrigin: config 3:21:59 PM: redirects: 3:22:00 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 3:22:00 PM: Failing build: Failed to build site 3:22:01 PM: Finished processing build request in 14.718s 3:22:00 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2) 3:21:59 PM: Netlify Build 3:21:59 PM: ──────────────────────────────────────────────────────────────── 3:21:59 PM: ​ 3:21:59 PM: ❯ Version 3:21:59 PM: @netlify/build 29.17.1 3:21:59 PM: ​ 3:21:59 PM: ❯ Flags 3:21:59 PM: baseRelDir: true 3:21:59 PM: buildId: 64c04ad11193bb10981e9731 3:21:59 PM: deployId: 64c04ad11193bb10981e9733 3:21:59 PM: ​ 3:21:59 PM: ❯ Current directory 3:21:59 PM: /opt/build/repo 3:21:59 PM: ​ 3:21:59 PM: ❯ Config file 3:21:59 PM: /opt/build/repo/netlify.toml 3:21:59 PM: ​ 3:21:59 PM: ❯ Context 3:21:59 PM: production 3:21:59 PM: ​ 3:21:59 PM: build.command from netlify.toml 3:21:59 PM: ──────────────────────────────────────────────────────────────── 3:21:59 PM: ​ 3:21:59 PM: $ hugo --gc --minify 3:21:59 PM: Error: Unable to locate config file or config directory. Perhaps you need to create a new site. 3:21:59 PM: Runhugo help newfor details. 3:21:59 PM: Total in 0 ms 3:21:59 PM: ​ 3:21:59 PM: build.command failed 3:21:59 PM: ──────────────────────────────────────────────────────────────── 3:21:59 PM: ​ 3:21:59 PM: Error message 3:21:59 PM: Command failed with exit code 255: hugo --gc --minify (https://ntl.fyi/exit-code-255) 3:21:59 PM: ​ 3:21:59 PM: Error location 3:21:59 PM: In build.command from netlify.toml: 3:21:59 PM: hugo --gc --minify 3:21:59 PM: ​ 3:21:59 PM: Resolved config 3:21:59 PM: build: 3:21:59 PM: command: hugo --gc --minify 3:21:59 PM: commandOrigin: config 3:21:59 PM: environment: 3:21:59 PM: - HUGO_VERSION 3:21:59 PM: - HUGO_ENV 3:21:59 PM: - HUGO_ENABLEGITINFO 3:21:59 PM: publish: /opt/build/repo/public 3:21:59 PM: publishOrigin: config 3:21:59 PM: redirects: 3:22:00 PM: Build failed due to a user error: Build script returned non-zero exit code: 2 3:22:00 PM: Failing build: Failed to build site 3:22:01 PM: Finished processing build request in 14.718s

This is the link to my repo https://github.com/jesicasusanto/oa.blog The error is indicating that it is unable to locate config file.

KhalilSecurity commented 1 year ago

Looks similar to this issue https://github.com/nusserstudios/tailbliss/issues/123 Also mentioned in official netlify docs https://docs.netlify.com/integrations/frameworks/hugo/

The fix there was to update netlify.toml with the correct version of hugo you run locally. So from you local environment command line execute hugo version. It should tell you the version number

~/tailbliss$ hugo version
hugo v0.115.3-5c2e014a5150553a9fa4f9c1eb7dc4db89c0f1ab+extended linux/amd64 BuildDate=2023-07-13T16:11:34Z VendorInfo=gohugoio

so I would update netlify.toml to reflect (update in all 4 spots in the file not just one) HUGO_VERSION = "0.115.3"