npx
lets you run different versions of Hugo without installation. To use it, install Node.js and npm at first.
Run different versions
The syntax of npx
is npx <package-name>@<version>
. If @<version>
is not specified, the locally installed version or latest version will be used. Here are some examples:
|
|
Available versions are listed here. Oldest version is 0.63.2. If you want to use the older versions, use hugo-bin package instead. Its version doesn’t match the Hugo version, so you have to check its commit history.
|
|
Install a specific version
You can install a specific version of Hugo in a git repository.
|
|
If you clone the repository, install the Hugo before using it.
|
|
Clean cache
|
|
This tutorial was tested with npm/npx v10.2.4 and Node.js v21.2.0 on Arch Linux.