1

Below is the output from my attempt to update wp-cli on Windows 10. Clearly another version is available. Can someone please explain how to make this work?

C:\Users\HP>wp cli update
Error: You can only self-update Phar files.

C:\Users\HP>wp cli check-update
+---------+-------------+-----------------------------------------------------------------------------+
| version | update_type | package_url                                                                 |
+---------+-------------+-----------------------------------------------------------------------------+
| 1.1.0   | major       | https://github.com/wp-cli/wp-cli/releases/download/v1.1.0/wp-cli-1.1.0.phar |
+---------+-------------+-----------------------------------------------------------------------------+
  • How is your copy of WP CLI installed? The message indicates that you have not used the standard WP CLI installation method of downloading and moving a .phar file – Tom J Nowell Mar 27 '17 at 18:46
  • I installed it thusly: composer global require wp-cli/wp-cli composer global require psy/psysh – Robin Andrews Mar 27 '17 at 18:55
  • have you tried updating it with composer? – Tom J Nowell Mar 27 '17 at 22:42
  • @Robin Did you manage to update WP-CLI? – Sven Feb 19 '18 at 22:39
1

First of all, locate your installation of WP-CLI.


If you're using Composer you can list all globally installed packages on the command line like this:

composer global show

Then update the WP-CLI composer package:

composer global update wp-cli/wp-cli

If you're using Homebrew, you can list all installed packages on the command line like this:

brew list

And update the package:

brew upgrade wp-cli

After that you should be able to upgrade to the next version of WP-CLI via the built-in command:

wp cli update

In return, you'll get a prompt like this:

You have version 1.4.1. Would you like to update to 1.5.0? [y/n]


Downloading from https://github.com/wp-cli/wp-cli/releases/download/v1.5.0...
New version works. Proceeding to replace.
Success: Updated WP-CLI to 1.5.0.
| improve this answer | |
  • 1
    I have version 1.5.0, when I run wp cli check-update it says 2.0.0 is available, but when I run composer global update wp-cli/wp-cli it says it's already updated, and I also got "You can only self-update Phar files" when I try to run wp cli update :| – Lucas Bustamante Aug 10 '18 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.