Question

I'm having problems with my composer packages. I have created 3 packages for to use with my Laravel application, but for some reason the "composer update" keeps on failing on me. It's really difficult to find the problem as it some how works on my local machine, but it doesn't work on the production server.

This is what my composer.json looks like...

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"repositories": [
    {
        "type": "vcs",
        "url": "git@bitbucket.org:mbrookspulse8/admin.git",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-sliders.git",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-parks.git",
        "branches-path": false,
        "tags-path": false
    }
],
"require": {
"laravel/framework": "4.1.*",
    "cartalyst/sentry": "2.1.*",
    "imagine/Imagine": "0.5.0",
    "edvinaskrucas/notification": "2.*",
    "way/generators": "dev-master",
    "pulse8/admin": "dev-master",
    "pulse8/sliders": "dev-master",
    "pulse8/parks": "dev-master",
    "geedmo/yamm3": "dev-master"
},
"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "stable"
}

I have tried changing the minimum stability to "dev", but to no avail. The "branches-path": false, and "tags-path": false weren't originally in there, but I placed them in to see if that would fix my problem with nothing.

Every change I have made, I have tested on my local which always works, but it never seems to work on my production. SSH is set up properly to retrieve my files.

It just says "Your requirements could not be resolved to an installable set of packages."

It's confusing how it's the exact same set up as my local, but it won't work on production...

Was it helpful?

Solution

You cannot stuff more than one repository into one repository structure inside the JSON. This is a limitation of JSON, but it is the same with regular PHP arrays: You cannot have more than one array key named "url" in an array.

"repositories": [
    {
        "type": "vcs",
        "url": "git@bitbucket.org:mbrookspulse8/admin.git",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-sliders.git",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-parks.git",
        "branches-path": false,
        "tags-path": false
    }
],

These repositories have to go into a dedicated structure each. That's why it is called "repositories" which is a numbered array of structures (see the [ ] brackets around the curly braces).

"repositories": [
    {
        "type": "vcs",
        "url": "git@bitbucket.org:mbrookspulse8/admin.git",
        "branches-path": false,
        "tags-path": false
    },
    {
        "type": "vcs",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-sliders.git",
        "branches-path": false,
        "tags-path": false
    },
    {
        "type": "vcs",
        "url": "git@bitbucket.org:pulse8/haulfryn-admin-parks.git",
        "branches-path": false,
        "tags-path": false
    }
],
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top