I’m having issues running Hugo after updating it to hugo_extended_0.74.3_macOS-64bit. I followed the installation via tarball instructions, but when I run which hugo via the command line it returns ‘hugo not found’. It was running normally before the update. I’ve tried to roll back to the prior version, but get the same error when attempting to run hugo or check the version.
I downloaded the appropriate latest release here, confirmed the download, extracted it and moved it to ~/bin. I then verified it runs via ./hugo version, and added export PATH=$PATH:$HOME/bin to my PATH variable. I noticed the permissions on the extracted Hugo executable wasn’t 777 (like in the instructions example), so I changed it just to be sure.
I think I understand but a little more clarity would help me. I edited my base_profile via $ nano ~/.bash_profile, then entered export PATH=$PATH:$HOME/bin and saved the file (as the hugo documentation instructs). You are saying that a successful permanent updated you mean I see $HOME/bin when echoing $PATH, correct?
I’ve noticed that if I simple enter export PATH=$PATH:$HOME/bin then type which hugo, it echos the correct path to the hugo executable (in same shell). I’ve tried restarting my machine but to no avail – same error: hugo not found.
Not a Hugo issue but for those that might have encountered this as well:
The issue stems from zsh (Z shell) being the new default shell starting with macOS Catalina. To resolve, I first verified shell was zsh with echo $SHELL, then went home with cd ~/ created a profile via $ touch .zprofile and opened it with open .zprofile. The final step is to add export PATH=$PATH:$HOME/bin to the profile file and close it. You can verify it worked by opening a new shell window and running which hugo to see the updated path.