copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Installing a different version through npm does not work

Open maxatchief1 opened this issue 10 months ago • 5 comments

Describe the bug

When I already have copilot installed, and I try to install a different version using (for example):

npm install -g @github/[email protected]

The npm command says it updated the packages, but when I run copilot, the current version (0.0.397) remains in place.

This is frustrating, especially when newer versions have bugs/regressions that completely break my process.

Affected version

0.0.397

Steps to reproduce the behavior

On a computer with Copilot installed with npm, run:

npm install -g @github/copilot@<version>

Where <version> is a version that is different than the version currently installed.

Expected behavior

I would expect Copilot to respect the version installed (or uninstalled) by my selected package manager.

Additional context

No response

maxatchief1 avatar Jan 28 '26 19:01 maxatchief1

Apologies for the inconvenience here @maxatchief1, if you run with --no-auto-update that should respect the installed version. Also, if you were affected by the 'invalid session id' issue on 0.0.397, we just published 0.0.398 addressing the issue.

devm33 avatar Jan 28 '26 19:01 devm33

I appreciate the workarounds you have available.

However,

  1. Any application that doesn't respect the package manager it was installed through as its default behavior is unintuitive.
  2. I don't want to have to add --no-auto-update onto my copilot command every time I run it.

maxatchief1 avatar Jan 28 '26 20:01 maxatchief1

@maxatchief1 that's fair. You can persist the --no-auto-update preference by adding "auto_update": false to your .copilot/config.json file.

devm33 avatar Jan 28 '26 20:01 devm33

That config doesn't seem to work:

$ copilot --version
GitHub Copilot CLI 0.0.400.
Run 'copilot update' to check for updates.
$ copilot --version --no-auto-update
0.0.384
Commit: 0b21260

As you can see, I still need the --no-auto-update flag. I can confirm that the behavior is different, i.e. this is not just the shown version that is wrong.

Here's the config I used:

{
    "auto_update": false
}

antoyo avatar Feb 01 '26 00:02 antoyo

Ah sorry you're right @antoyo the auto_update config only currently prevents it from downloading new updates, doesn't prevent it from loading the latest downloaded. Will get that fix. If you rm -rf ~/.copilot/pkg/ (or $XDG_CONFIG_HOME/.copilot/pkg) that should give you a workaround in the meantime.

devm33 avatar Feb 02 '26 03:02 devm33