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

Fresh laravel installation failed #96

Closed
raakkan opened this issue Apr 7, 2024 · 22 comments
Closed

Fresh laravel installation failed #96

raakkan opened this issue Apr 7, 2024 · 22 comments

Comments

@raakkan
Copy link

raakkan commented Apr 7, 2024

Fresh laravel installation failed with this error

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

Problem 1
- outhebox/laravel-translations[0.0.1, ..., 0.1.2] require brick/varexporter ^0.3.7 -> satisfiable by brick/varexporter[0.3.7, 0.3.8].
- outhebox/laravel-translations 1.0.0 requires inertiajs/inertia-laravel ^0.6.11 -> satisfiable by inertiajs/inertia-laravel[v0.6.11].
- outhebox/laravel-translations[1.0.1, ..., 1.1.1] require brick/varexporter ^0.4.0 -> satisfiable by brick/varexporter[0.4.0].
- outhebox/laravel-translations[1.0.2, ..., 1.0.9] require brick/varexporter ^0.3.7|^0.4.0 -> satisfiable by brick/varexporter[0.3.7, 0.3.8, 0.4.0].
- brick/varexporter[0.3.7, ..., 0.4.0] require nikic/php-parser ^4.0 -> found nikic/php-parser[v4.0.0, ..., v4.19.1] but these were not loaded, likely because it conflicts with another require.
- inertiajs/inertia-laravel[v0.6.10, ..., v0.6.11] require laravel/framework ^6.0|^7.0|^8.74|^9.0|^10.0 -> found laravel/framework[v6.0.0, ..., v6.20.44, v7.0.0, ..., v7.30.6, v8.74.0, ..., v8.83.27, v9.0.0, ..., v9.52.16, v10.0.0, ..., v10.48.4] but it conflicts with your root composer.json require (^11.0).
- Root composer.json requires outhebox/laravel-translations * -> satisfiable by outhebox/laravel-translations[0.0.1, ..., 0.1.2, 1.0.0, ..., 1.1.1].

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

@JorgenSolli
Copy link

Try upgrading laravel-inertia to ^1.0 in composer.json

...
"inertiajs/inertia-laravel": "^1.0"
..

@raakkan
Copy link
Author

raakkan commented Apr 7, 2024

im installed inertia 1.0 with composer require inertiajs/inertia-laravel and composer require outhebox/laravel-translations --with-all-dependencies returns this error

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

Problem 1
- outhebox/laravel-translations[0.0.1, ..., 0.1.2] require brick/varexporter ^0.3.7 -> satisfiable by brick/varexporter[0.3.7, 0.3.8].
- outhebox/laravel-translations[1.1.0, ..., 1.1.1] require brick/varexporter ^0.4.0 -> satisfiable by brick/varexporter[0.4.0].
- outhebox/laravel-translations[1.0.0, ..., 1.0.9] require inertiajs/inertia-laravel ^0.6.11 -> found inertiajs/inertia-laravel[v0.6.11] but it conflicts with your root composer.json require (^1.0).
- brick/varexporter[0.3.7, ..., 0.4.0] require nikic/php-parser ^4.0 -> found nikic/php-parser[v4.0.0, ..., v4.19.1] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires outhebox/laravel-translations * -> satisfiable by outhebox/laravel-translations[0.0.1, ..., 0.1.2, 1.0.0, ..., 1.1.1].

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

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

@JorgenSolli
Copy link

Are you sure you're installing the latest version of this package? I see that v1.0.0 requires inertia-laravel: 0.6, but the latest uses 1.1.

@raakkan
Copy link
Author

raakkan commented Apr 7, 2024

im installed fresh laravel with composer only installed inertia-laravel package no other package was installed try to install this package returns the above error. please try this translation package installation in frash laravel project.

@cwbsl
Copy link

cwbsl commented Apr 16, 2024

I get the same error as @raakkan in my project. I did run composer update before trying to install the package but it didn't help.

@emtiazzahid
Copy link

emtiazzahid commented Apr 18, 2024

same error here, i dont have inertia-laravel installed in my project.
laravel 11 and PHP 8.3

probably related issue brick/varexporter#31

@MohmmedAshraf
Copy link
Owner

MohmmedAshraf commented Apr 19, 2024

Hi @raakkan, please use the following command to install

composer require outhebox/laravel-translations --with-all-dependencies

@cwbsl
Copy link

cwbsl commented Apr 19, 2024

@MohmmedAshraf that's the command I tried to use as well in my project and I get the same error as the other users do with it.

@MohmmedAshraf
Copy link
Owner

Hi @cwbsl, i just installed fresh Laravel app and installed the package without any issue with same command

@JorgenSolli
Copy link

Perhaps sharing your composer.json contents would help.

@tsegkos
Copy link

tsegkos commented Apr 22, 2024

I have the same problem. Even on a fresh installation of laravel getting the same conflicts on composer.

@MohmmedAshraf
Copy link
Owner

MohmmedAshraf commented Apr 22, 2024

Perhaps sharing your composer.json contents would help.

{
    "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.0",
        "laravel/tinker": "^2.9",
        "outhebox/laravel-translations": "^1.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "pestphp/pest": "^2.34",
        "pestphp/pest-plugin-laravel": "^2.3",
        "spatie/laravel-ignition": "^2.4"
    },
    "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
}

@tsegkos
Copy link

tsegkos commented Apr 22, 2024

Seems like when i use :
"pestphp/pest": "^2.34", "pestphp/pest-plugin-laravel": "^2.3",

instead of "phpunit/phpunit": "^11.0.1",

it works well.

@iammursal
Copy link

Command composer require outhebox/laravel-translations --with-all-dependencies not working for me

./composer.json has been updated
Running composer update outhebox/laravel-translations --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - outhebox/laravel-translations[0.1.1, ..., 0.1.2, 1.0.0] require brick/varexporter ^0.3.7 -> satisfiable by brick/varexporter[0.3.7, 0.3.8].
    - outhebox/laravel-translations[1.0.1, ..., 1.1.6] require brick/varexporter ^0.4.0 -> satisfiable by brick/varexporter[0.4.0].
    - outhebox/laravel-translations[1.0.2, ..., 1.0.9] require brick/varexporter ^0.3.7|^0.4.0 -> satisfiable by brick/varexporter[0.3.7, 0.3.8, 0.4.0].
    - outhebox/laravel-translations[0.0.1, ..., 0.0.7] require livewire/livewire ^2.10 -> found livewire/livewire[v2.10.0, ..., v2.12.6] but it conflicts with your root composer.json require (^3.0).
    - brick/varexporter[0.3.7, ..., 0.4.0] require nikic/php-parser ^4.0 -> found nikic/php-parser[v4.0.0, ..., v4.19.1] but these were not loaded, likely because it conflicts with another require.
    - outhebox/laravel-translations 1.1.0 requires illuminate/contracts ^11.0 -> found illuminate/contracts[v11.0.0, ..., v11.4.0] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires outhebox/laravel-translations * -> satisfiable by outhebox/laravel-translations[0.0.1, ..., 0.1.2, 1.0.0, ..., 1.1.6].

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

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

composer.json

@irvanalfi
Copy link

Perhaps sharing your composer.json contents would help.

{
    "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.0",
        "laravel/tinker": "^2.9",
        "outhebox/laravel-translations": "^1.0"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "pestphp/pest": "^2.34",
        "pestphp/pest-plugin-laravel": "^2.3",
        "spatie/laravel-ignition": "^2.4"
    },
    "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
}

i created new project => copy MohmmedAshraf scripts to my composer.json => run composer update => run all command start from this command "php artisan translations:install". its work for me.

@cwbsl
Copy link

cwbsl commented Apr 23, 2024

So it seems that when using PHPUnit it doesn't work, but when using Pest it's working. We can't switch to Pest for now, is there a solution to keep using PHPUnit?

@JorgenSolli
Copy link

@MohmmedAshraf Perhaps the composer.json file in this package can be cleaned up a little to prevent these issues. Mine installed just fine, so I can't directly relate, but here are a few observations:

Both phpunit/phpunit and pestphp/pest are defined. Pest is dependent on PHPUnit, so PHPUnit can be removed from this package's dependency.

illuminate/contracts is also required, which is a direct dependency of Laravel. Perhaps I'm missing something here, but I believe you could let the Laravel framework handle that dependency. Unless this package is also intended for other PHP frameworks or applications.

@MohmmedAshraf
Copy link
Owner

MohmmedAshraf commented Apr 23, 2024

Hi @JorgenSolli, Thank you you are correct i just didn't notice that both are included in the composer.json also i don't have enough time to debug this out, i've applied ur suggestion hopefully it will works.

@MohmmedAshraf
Copy link
Owner

Hi @cwbsl, please check the latest release and let me know if it works for you

@cwbsl
Copy link

cwbsl commented Apr 24, 2024

I ran this command:

composer require outhebox/laravel-translations --with-all-dependencies

And got this output:

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

  Problem 1
    - outhebox/laravel-translations[0.0.1, ..., 0.1.2, 1.0.0] require brick/varexporter ^0.3.7 -> satisfiable by brick/varexporter[0.3.7, 0.3.8].
    - outhebox/laravel-translations[1.0.1, ..., 1.1.7] require brick/varexporter ^0.4.0 -> satisfiable by brick/varexporter[0.4.0].
    - outhebox/laravel-translations[1.0.2, ..., 1.0.9] require brick/varexporter ^0.3.7|^0.4.0 -> satisfiable by brick/varexporter[0.3.7, 0.3.8, 0.4.0].
    - brick/varexporter[0.3.7, ..., 0.4.0] require nikic/php-parser ^4.0 -> found nikic/php-parser[v4.0.0, ..., v4.19.1] but these were not loaded, likely because it conflicts with another require.
    - outhebox/laravel-translations 1.1.0 requires illuminate/contracts ^11.0 -> found illuminate/contracts[v11.0.0, ..., v11.5.0] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires outhebox/laravel-translations * -> satisfiable by outhebox/laravel-translations[0.0.1, ..., 0.1.2, 1.0.0, ..., 1.1.7].

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

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

This is my composer require parts:

"require": {
        "php": "^8.3",
        "ext-openssl": "*",
        "ext-pdo": "*",
        "akaunting/laravel-firewall": "^2.1",
        "biscolab/laravel-recaptcha": "^6.0",
        "gearbox-solutions/eloquent-filemaker": "2.0",
        "google/cloud-translate": "^1.15",
        "guzzlehttp/guzzle": "^7.5.0",
        "halaxa/json-machine": "^1.1.3",
        "itsgoingd/clockwork": "^5.1",
        "jorijn/laravel-security-checker": "^2.4",
        "larabug/larabug": "^3.0",
        "laravel/fortify": "^1.17",
        "laravel/framework": "^10.0",
        "laravel/sanctum": "^3.2.1",
        "laravel/tinker": "^2.8",
        "mattketmo/email-checker": "^2.1",
        "mlocati/ip-lib": "^1.18",
        "monarobase/country-list": "^3.4",
        "opcodesio/log-viewer": "^3.1",
        "outhebox/blade-flags": "*",
        "pragmarx/google2fa-laravel": "^2.1",
        "simonschaufi/laravel-dkim": "^3.0",
        "simplesoftwareio/simple-qrcode": "~4",
        "spatie/laravel-cookie-consent": "*",
        "spatie/laravel-sitemap": "^7.2",
        "stevebauman/location": "*"
    },
    "require-dev": {
        "ext-json": "*",
        "barryvdh/laravel-debugbar": "^3.8",
        "fakerphp/faker": "^1.9.1",
        "knuckleswtf/scribe": "^4.22",
        "laravel/dusk": "^7.12",
        "laravel/pint": "^1.13",
        "mockery/mockery": "^1.5.1",
        "nunomaduro/collision": "^v7.0",
        "phpunit/phpunit": "^10.0",
        "spatie/laravel-ignition": "^2.0"
    },

@jonasfrisell
Copy link
Contributor

I'd recommend waiting for Pull Request #115 to get merged. However, if you urgently need it, you can add the following to composer.json and then run composer update and you should be good to go:

    "require": {
        "outhebox/laravel-translations": "dev-main"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/jonasfrisell/laravel-translations"
        }
    ]  

Make sure to switch back to the official package once the merge is through.

@MohmmedAshraf
Copy link
Owner

This should be fixed in the latest version thanks to @jonasfrisell

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

9 participants