Upgrade Antora

On this page, you’ll learn:

  • How to upgrade the Antora CLI.

  • How to upgrade the default Antora site generator.

The CLI version and default site generator version must be the same. If you follow these instructions when you upgrade, the versions will stay in sync.

Upgrade the CLI

To upgrade the CLI, open a terminal and type:

$ npm i -g @antora/cli

The Node package manager (npm) will automatically install the latest version of the CLI.

If you installed the CLI and the default site generator globally, you can upgrade both of them with the same command.

$ npm i -g @antora/cli @antora/site-generator-default

npm tips

To list the Node packages you have installed globally, type the following command in your terminal:

$ npm ls -g --depth=0

If the CLI and generator are installed globally, you’ll see them listed in the terminal output. The output will also show the CLI and generator versions, which should match.

List of globally installed Node packages
/home/user/.nvm/versions/node/v8.9.3/lib
├── @antora/cli@1.0.0-alpha.6
├── @antora/site-generator-default@1.0.0-alpha.6
├── npm@5.6.0
└── ...

To list the Node packages you have installed in a directory, go to that directory and type:

dir $ npm ls --depth=0

Upgrade the default site generator

The method for upgrading the default site generator depends on whether it is installed globally or in a project directory.

If it’s installed globally, the command to upgrade it is:

$ npm i -g @antora/site-generator-default

If you installed the generator in a project directory, update the generator’s version number in the package file.

  1. Go to your project directory and open the package.json file.

  2. Change the version number, and save the file.

    {
      "dependencies": {
        "@antora/site-generator-default": "^1.0.0-alpha.6"
      }
    }
  3. Next, upgrade the site generator by running npm.

    project-dir $ npm install
If you’re using yarn instead of npm, run the yarn command after updating package.json. It may be necessary to pass the --force flag to force an update.

You’ve now upgraded to the latest version of the Antora CLI and default site generator.

What’s next?