[FreeBSD] Cannot install/run the Doks theme "you need the extended version to build SCSS/SASS" but I have the extended version installed

Hello,

I’m trying to create a documentation website for myself and I really wanted to try out Doks but I cannot get it to run. I’m running this inside a Jail on my TrueNAS server. I followed the instructions but when starting the website I get the following error:

Error: Error building site: TOCSS: failed to transform "scss/app.scss" (text/x-scss). Check your Hugo installation; you need the extended version to build SCSS/SASS.

But when I check the version of Hugo I have the extended version installed:

# hugo version
Hugo Static Site Generator v0.80.0-792EF0F4/extended freebsd/amd64 BuildDate: 2021-01-01T14:01:20Z+0000

These are the other versions of the required packages I have installed:

  • npm-6.14.8
  • go-1.15.7,1
  • gohugo-0.80.0
  • node-15.6.0

How can I resolve this error and use Doks? Thanks!

Would you mind upgrading npm to version 7 and please try again?

Note 1) Doks (the latest version) only requires npm (it installs the correct Hugo version as a dependency).

Note 2) Node.js 15.6.0 includes npm 7.4.0.

In addition) To make sure the extended Hugo version gets installled, delete the ./node_modules folder, and run again npm install.

Hello @h-enk thanks for your reply (bedankt!)

I think things work a bit different on FreeBSD unfortunatly. I uninstalled the version of npm I had but now I no longer have access to the npm command.

When I search for npm in the package manager I can’t find version 7.x

# pkg search npm
npm-6.14.8                     Node package manager
npm-node10-6.14.8              Node package manager
npm-node12-6.14.8              Node package manager
npm-node14-6.14.8              Node package manager

I do have NodeJS 15.6.0

# node -v
v15.6.0

Unsure how to get npm 7.x.

Another note from me: yesterday I tried several other themes that specified they required the extended version of Hugo and as far as I could tell these themes worked well. But those theme installtion were following the normal method of just cloning the Git repository to the themes folder and I also tried one using the modules functionality of Hugo but that is something I don’t fully understand yet even after reading the documentation multiple times and watching a video on it.

@Mannekino, graag gedaan!

I’m in the dark how you are able to run the extended version for Hugo, I don’t see it published for FreeBSD: Release v0.80.0 · gohugoio/hugo · GitHub

That having said, to make it work for you, you could use your globally installed Hugo version. Just run npm uninstall hugo-bin and try again.

Hugo is in the repository of the FreeBSD package manager. I’m not to familiar with the nomenclature but I believe they are called “Ports”. You can see view the gohugo package here: FreshPorts -- www/gohugo: Fast and flexible static site generator

If you scroll a bit to the bottom you can find a section called Configuration Options where you see that Hugo have been configured with EXTENDED=on.

Your solution seem to have worked but I can’t use it yet. I need to pass other configuration option to the Hugo server like the port and IP it needs to bind on and the baseURL. How would you do that with this npm run start command? I searched in the documentation of Doks but can’t find anything.

This “theme” seems a bit intimidating. I spent a great deal of time learning Hugo past weekend, watched a course and read lots of documentation but this theme goes way beyond what I’ve learned so far and I don’t have a good grasp on how it works underneath so to speak.

Add it to the npm run start command, e.g.:

    "start": "hugo server --disableFastRender --bind 0.0.0.0 --baseURL http://192.168.1.10:1313/",

What would the full command be? Because that doesn’t work unfortunately.

npm run start "start": "hugo server --bind 192.168.178.18 -p 1414 -b http://test.fritz.box",

I understand /I’m aware, Doks is set up in a different way. I’m currently in the process of explaining why, how, and what.

Firstly, I’m writing a series of three posts on mastering npm with Hugo (the first post was published last Thursday, the second and third will folllow shortly):

  1. Master npm with Hugo: an introduction to npm
  2. Master npm with Hugo: managing dependencies
  3. Master npm with Hugo: customizing build scripts

Secondly, I’m planning a more specific post relevant for Doks (and for Hyas).

1 Like

Update in ./package.json the start command. Make it: hugo server --bind 192.168.178.18 -p 1414 -b http://test.fritz.box.

Then run from the comand line npm run start

Thank you that has worked!

The site has launched successfully and everything seems to be looking great. I see no signs of broken styles or images. Now I need to familiarize myself with this “theme” and how everything is set up. I’m looking for a system for my personal documentation instead of this monster of a plain text file I’ve created for all the stuff I’ve done with my TrueNAS server.

I am completely new to npm. Even though it’s working now I have no idea what’s actually happening. I will read the first post you’ve created.

I do want my Doks site to be a bit different than the default one. I don’t really need a home page. I would like the home page to go straight into the documentation. Since I’m also new to Hugo it’s all a bit overwhelming still.

I understand the basics of Hugo now. This weekend I watched this entire tutorial series and followed along with all the stuff shown in my own Hugo site: Hugo - Static Site Generator | Tutorial - YouTube

This week I plan on watching this 20 Minute Hugo - YouTube

I also want to use Hugo to create a simple site for my own business but that’s another topic. I’m currently going through all the themes and hopefully I will find something to my liking.

Thanks again.

1 Like

You could:

  1. Rename .layouts/index.html to .layouts/index.bak.html (see also: Examples: Layout Lookup for Home Page)
  2. Add to the front matter of the page you would like to be the homepage: url: / (see also Front Matter)

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.