statamic / cli

Install and manage your Statamic projects from the command line.
71 stars 19 forks source link

Fatal error: Uncaught TypeError: Unsupported operand types: CurlHandle / int in /Users/macpro... #64

Closed mware closed 8 months ago

mware commented 8 months ago

Cannot create a new site with the CLI. Running Composer 2.5.5 Statamic CLI 1.0.3 Mac OS Sonoma 14.0

Running statamic new whatever throws an error:

Checking for the latest version... [✔] 2.11.22
Downloading...
Press Ctrl+C to cancel.

Fatal error: Uncaught TypeError: Unsupported operand types: CurlHandle / int in /Users/macpro/.composer/vendor/statamic/cli/src/Downloader.php:81

There might be user error involved or something that needs to be configured on my end? Thanks

jasonvarga commented 8 months ago

Your version of cli is super old.

Try running composer global require statamic/cli to update.

mware commented 8 months ago

Thank you @jasonvarga. Ran it, still stuck on 1.0.3. Nothing to install, update or remove I think the issue is more on my end. We can close this.

jasonvarga commented 8 months ago

Ok how about composer global require statamic/cli:^3

mware commented 8 months ago

no matches found: statamic/cli:^3

jasonvarga commented 8 months ago

composer -V ?

mware commented 8 months ago

Composer version 2.5.5

jasonvarga commented 8 months ago

Try composer self-update and then composer global require statamic/cli:^3 again. Paste the entire output.

mware commented 8 months ago

Here's what I get in return

Upgrading to version 2.6.5 (stable channel).

Use composer self-update --rollback to return to version 2.5.5
macpro@MacBook-Pro-2 ~ % composer global require statamic/cli:^3
zsh: no matches found: statamic/cli:^3
robdekort commented 8 months ago

~What about composer global update statamic/cli?~

jasonvarga commented 8 months ago

Ok 😄 How about this:

composer global require "statamic/cli ^3.0"
jasonvarga commented 8 months ago

@robdekort If he has v1 in his composer.json file, an update isn't going to make the major jump to 3.

robdekort commented 8 months ago

Ah got it. I'll see myself out.

mware commented 8 months ago

Can I edit that file directly? Currently:

{
    "require": {
        "squizlabs/php_codesniffer": "*",
        "statamic/cli": "^1.0"
    }
}
jasonvarga commented 8 months ago

Yep, change that to ^3.0 then run composer global update.

mware commented 8 months ago

Success! The CLI tool now works as expected. Thank you so much for patience and sticking with this one. -Michael