diff --git a/content/copilot/how-tos/copilot-cli/cli-getting-started.md b/content/copilot/how-tos/copilot-cli/cli-getting-started.md index 429fa006346c..5a63314c7942 100644 --- a/content/copilot/how-tos/copilot-cli/cli-getting-started.md +++ b/content/copilot/how-tos/copilot-cli/cli-getting-started.md @@ -25,21 +25,23 @@ Use one of these commands: * **Cross-platform (npm)** - ```bash copy - npm install -g @github/copilot - ``` + Prerequisite: {% data variables.copilot.copilot_cli_npm_version %}. + + ```bash copy + npm install -g @github/copilot + ``` * **Windows (WinGet)** - ```bash copy - winget install GitHub.Copilot - ``` + ```bash copy + winget install GitHub.Copilot + ``` * **macOS/Linux (Homebrew)** - ```bash copy - brew install copilot-cli - ``` + ```bash copy + brew install copilot-cli + ``` ## Starting the CLI for the first time diff --git a/content/copilot/how-tos/copilot-cli/install-copilot-cli.md b/content/copilot/how-tos/copilot-cli/install-copilot-cli.md index a012a3f03b1d..cffd5f381ae8 100644 --- a/content/copilot/how-tos/copilot-cli/install-copilot-cli.md +++ b/content/copilot/how-tos/copilot-cli/install-copilot-cli.md @@ -36,6 +36,27 @@ If you have access to {% data variables.product.prodname_copilot %} via your org You can install {% data variables.copilot.copilot_cli_short %} using WinGet (Windows), Homebrew (macOS and Linux), npm (all platforms), or an install script (macOS and Linux). +### Installing with npm (all platforms) + +Prerequisite: {% data variables.copilot.copilot_cli_npm_version %}. + +```shell copy +npm install -g @github/copilot +``` + +> [!NOTE] +> If you have `ignore-scripts=true` in your `~/.npmrc` file, you must use the command: +> +> ```shell copy +> npm_config_ignore_scripts=false npm install -g @github/copilot +> ``` + +To install the prerelease version: + +```shell copy +npm install -g @github/copilot@prerelease +``` + ### Installing with WinGet (Windows) ```powershell copy @@ -60,18 +81,6 @@ To install the prerelease version: brew install copilot-cli@prerelease ``` -### Installing with npm (all platforms, requires Node.js 22+) - -```shell copy -npm install -g @github/copilot -``` - -To install the prerelease version: - -```shell copy -npm install -g @github/copilot@prerelease -``` - ### Installing with the install script (macOS and Linux) ```shell copy diff --git a/data/variables/copilot.yml b/data/variables/copilot.yml index c925e34e78e7..a1cde2d40bf8 100644 --- a/data/variables/copilot.yml +++ b/data/variables/copilot.yml @@ -72,6 +72,7 @@ copilot_cli_short: 'Copilot CLI' copilot_cli: 'GitHub Copilot CLI' copilot_old-cli_short: 'Copilot in the CLI' copilot_old-cli: 'GitHub Copilot in the CLI' +copilot_cli_npm_version: 'Node.js 22 or later' ## Copilot custom agents copilot_custom_agent: 'Copilot custom agent'