The first thing to check, regardless of your OS, is that you are running the correct version of Hugo and that it's the Extended version:
hugo versionThis will show something like:
hugo v0.108.0+extended darwin/arm64 BuildDate=unknown VendorInfo=macportsIn this example, 0.108.0 is the release and +extended indicates that it is the extended version.
You can see the list of Hugo releases here.
MacOS users encountering the fatal error: pipe failed error when running hugo server need to run these commands:
sudo launchctl limit maxfiles 65535 200000
ulimit -n 65535
sudo sysctl -w kern.maxfiles=100000
sudo sysctl -w kern.maxfilesperproc=65535To ensure these calls are made every time before running hugo server, consider using this script. Be sure to update the HUGO_DIRECTORY to match your install:
#!/bin/bash
cd /Users/HUGO_DIRECTORY/cht-docs
sudo launchctl limit maxfiles 65535 200000
ulimit -n 65535
sudo sysctl -w kern.maxfiles=100000
sudo sysctl -w kern.maxfilesperproc=65535
hugo serverSave this in file with the .command suffix (e.g. cht-docs-server.command) to enable an easy double clicking to start the server.
Note - be sure to enter your MacOS user password in the terminal when prompted.
MacOS M1 users encountering Error: failed to download modules: binary with name "go" not found when running hugo server need to install Golang by running:
brew install golang