electrikhq / electrik

Electrik is a full-featured, open-source, starter-kit to help you build you your SaaS application.
https://electrik.dev
MIT License
242 stars 19 forks source link

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

Open phenomenia opened 1 month ago

phenomenia commented 1 month ago

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

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 commented 1 month ago

Same issue

neerajsohal commented 1 month ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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"
        }
    ],
  3. 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 commented 3 weeks ago

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

{
    "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
}