Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails at step 2 (Requiire Electrik via composer) #37

Open
phenomenia opened this issue May 19, 2024 · 7 comments
Open

Installation fails at step 2 (Requiire Electrik via composer) #37

phenomenia opened this issue May 19, 2024 · 7 comments

Comments

@phenomenia
Copy link

In step 2 of the setup process I get the following error:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- electrik/electrik[0.0.1, ..., 0.0.13, 1.0.0] require illuminate/support ^9.31 -> found illuminate/support[v9.31.0, ..., v9.52.16] but these were not loaded, likely because it conflicts with another require.
- electrik/electrik[2.0.0, ..., 2.0.5] require illuminate/support ^10.10 -> found illuminate/support[v10.10.0, ..., v10.48.10] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires electrik/electrik * -> satisfiable by electrik/electrik[0.0.1, ..., 0.0.13, 1.0.0, 2.0.0, 2.0.5].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require electrik/electrik:*" to figure out if any version is installable, or "composer require electrik/electrik:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Any idea how to solve this?

@KneesDev
Copy link

Same issue

@neerajsohal
Copy link
Contributor

Hi

Apologies for late reply. I was not available. It seems like there is a version conflict. Please make sure that you are using Laravel 9. Upgrading Electrik for L10 didn't work and broke a lot of things. If you are using L11, then try installing the dev version ( 3.x-dev ). It should work.

I am currently working on 3.x branch and will release a version soon.

@cmarfil
Copy link

cmarfil commented Jun 11, 2024

Hello @neerajsohal !
I have tried electrik 3.x-dev with L11 but composer returns an error:

 Problem 1
    - Root composer.json requires electrik/electrik 3.x -> satisfiable by electrik/electrik[3.x-dev].
    - electrik/electrik 3.x-dev requires mpociot/teamwork dev-l11-compatibility as 8.1.0 -> found mpociot/teamwork[dev-master, dev-develop, 0.7.0, 1.0.0, ..., 1.2.1, 2.0.0, 2.0.1, 3.0.0, ..., 3.5.0, 4.0.0, ..., 4.1.0, 5.0.0, 5.1.0, 5.2.0, 5.3.0, 6.0.0, ..., 6.1.2, 7.0.0, 8.0.0, 8.1.0] but it does not match the constraint.

It seems that mpociot/teamwork dev-l11-compatibility branch does not exist, any temporary solution or way to install it?
Thank you!

@neerajsohal
Copy link
Contributor

I see. Apologies for this confusion. The @mpociot/teamwork has not released a L11 package yet. So I am using a forked version. Same is with Laravel Shift. Please use the following steps:

  1. Create a fresh Laravel project.
  2. Add the following in your composer.json:
"repositories": [
        {
            "type": "path",
            "url": "/Users/neerajsohal/lab/electrik/electrik",
            "options": {
                "symlink": true
            }
        },
        {
            "type": "vcs",
            "url": "https://github.com/laravel-shift/teamwork.git"
        }
    ],
  1. Install Electrik by following the steps from read me.

Thank you for pointing this out. I will add it to the project README as well.

I hope this helps.

Cheers!

@neerajsohal
Copy link
Contributor

neerajsohal commented Jun 14, 2024

For everyone's reference, below is the composer.json from one of the latest Laravel 11 with Electrik project that we are working on:

please ignore the below and refer to next one

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "electrik/electrik": "3.x-dev",
        "laravel/framework": "^11.0",
        "laravel/socialite": "^5.14",
        "laravel/tinker": "^2.9",
        "shopify/shopify-api": "^5.5",
        "socialiteproviders/shopify": "^4.1"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "phpunit/phpunit": "^11.0.1",
        "spatie/laravel-ignition": "^2.4"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "repositories": [
        {
            "type": "path",
            "url": "/Users/neerajsohal/lab/electrik/electrik",
            "options": {
                "symlink": true
            }
        },
        {
            "type": "vcs",
            "url": "https://github.com/laravel-shift/teamwork.git"
        }
    ],
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi",
            "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
            "@php artisan migrate --graceful --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

please refer to the below

updated composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "laravel/framework": "^11.9",
        "laravel/tinker": "^2.9",
	"electrik/electrik":"3.x-dev"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "phpunit/phpunit": "^11.0.1"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi",
            "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
            "@php artisan migrate --graceful --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

@gojariya
Copy link

Getting error
"The url supplied for the path (/Users/neerajsohal/lab/electrik/electrik) repository does not exist"

@neerajsohal
Copy link
Contributor

Getting error "The url supplied for the path (/Users/neerajsohal/lab/electrik/electrik) repository does not exist"

Hi,

Thank you for bringing this too notice. Teamwork has released their latest version. I have updated the compooser.json to reflect this. Below is how it should look:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "laravel/framework": "^11.9",
        "laravel/tinker": "^2.9",
	"electrik/electrik":"3.x-dev"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "phpunit/phpunit": "^11.0.1"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi",
            "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
            "@php artisan migrate --graceful --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants