Can't install package with composer v1 #10772

Open
opened 2025-11-02 09:17:46 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @Eddcapone on GitHub (May 3, 2023).

Description

I have a repository named vendor1/simple-module1.
I created a new release and tag (v1.0.0). Then I downloaded my repo as a zip and PUT it to make it available as a package like described in the documentation.

curl --user your_username:your_password_or_token \
     --upload-file path/to/project.zip \
     https://gitea.example.com/api/packages/testuser/composer

Then I followed the other instructions from the documentation.

Then on my webserver I created a new folder with this composer.json:

 {
    "name": "myproject/mypackage",
    "description": "My Package Description",
    "type": "library",
    "keywords": [
        "php",
        "package",
        "myproject"
    ],
    "license": "MIT",
    "authors": [
        {
            "name": "John Doe",
            "email": "johndoe@example.com"
        }
    ],
    "require": {
        "php": ">=7.3.0"
    },
    "autoload": {
        "psr-4": {
            "MyProject\\MyPackage\\": "src/"
        }
    },
    "require-dev": {
        "squizlabs/php_codesniffer": "^3.5"
    },
    "repositories": {
        "git.company.de/api/packages/JohnDoe/composer": {
            "type": "composer",
            "url": "https://git.company.de/api/packages/JohnDoe/composer"
        }
    }
}

Next I tried to install my package with composer 1.10.26 (latest v1).

composer require vendor1/simple-module1

But I get:

[ErrorException]
Illegal string offset 'versions'

If I try it again with composer v2 (e.g 2.5.5) then it works.

Gitea Version

1.19.0

Can you reproduce the bug on the Gitea demo site?

Not tested

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

ubuntu

How are you running Gitea?

We host it ourself.
We installed from the prebuilt linux-amd-64 binary
It runs as systemd service at ubuntu

Database

Unknown

Originally created by @Eddcapone on GitHub (May 3, 2023). ### Description I have a repository named vendor1/simple-module1. I created a new release and tag (v1.0.0). Then I downloaded my repo as a zip and PUT it to make it available as a package like described in the [documentation](https://docs.gitea.io/en-us/usage/packages/composer). ``` curl --user your_username:your_password_or_token \ --upload-file path/to/project.zip \ https://gitea.example.com/api/packages/testuser/composer ``` Then I followed the other instructions from the documentation. Then on my webserver I created a new folder with this composer.json: ``` { "name": "myproject/mypackage", "description": "My Package Description", "type": "library", "keywords": [ "php", "package", "myproject" ], "license": "MIT", "authors": [ { "name": "John Doe", "email": "johndoe@example.com" } ], "require": { "php": ">=7.3.0" }, "autoload": { "psr-4": { "MyProject\\MyPackage\\": "src/" } }, "require-dev": { "squizlabs/php_codesniffer": "^3.5" }, "repositories": { "git.company.de/api/packages/JohnDoe/composer": { "type": "composer", "url": "https://git.company.de/api/packages/JohnDoe/composer" } } } ``` Next I tried to install my package with [composer 1.10.26](https://getcomposer.org/download/1.10.26/composer.phar) (latest v1). `composer require vendor1/simple-module1` But I get: [ErrorException] Illegal string offset 'versions' If I try it again with composer v2 (e.g 2.5.5) then it works. ### Gitea Version 1.19.0 ### Can you reproduce the bug on the Gitea demo site? Not tested ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System ubuntu ### How are you running Gitea? We host it ourself. We installed from the prebuilt linux-amd-64 binary It runs as systemd service at ubuntu ### Database Unknown
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 09:17:46 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10772