Issue installing laravel-doctrine/migrations package in laravel 9 - php

I am trying to install the migrations on a fresh install of laravel 9, however I am getting this error
Problem 1
Root composer.json requires laravel-doctrine/migrations ^2.3 -> satisfiable by laravel-doctrine/migrations[2.3.0, 2.3.1, 2.x-dev].
laravel-doctrine/migrations[2.3.0, ..., 2.x-dev] require illuminate/config ^6.0|^7.0|^8.0 -> found illuminate/config[v6.0.0,
..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these
were not loaded, likely because it conflicts with another require.
You can also try re-running composer require with an explicit version
constraint, e.g. "composer require laravel-doctrine/migrations:*" to
figure out if any version is installable, or "composer require
laravel-doctrine/migrations:^2.1" if you know which you need.
previously I installed the orm with this command
composer require laravel-doctrine/orm
I have tried to install other versions but the message is the same
composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"guzzlehttp/guzzle": "^7.2",
"laravel-doctrine/orm": "^1.8",
"laravel-doctrine/migrations":"^2.3",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"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"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
UPDATE
I am trying to install the package with laravel 8 however I have this error when executing the command for version ~1.7
command
composer require laravel-doctrine/orm doctrine/inflector:"^1.4|^2.0"
Error
Problem 1
- laravel-doctrine/orm[1.8.0, ..., 1.8.x-dev] require illuminate/support ^9.0 -> found illuminate/support[v9.0.0-beta.1,
..., 9.x-dev] but these were not loaded, likely because it conflicts
with another require.
- Root composer.json requires laravel-doctrine/orm ^1.8 -> satisfiable by laravel-doctrine/orm[1.8.0, 1.8.1, 1.8.x-dev].
You can also try re-running composer require with an explicit version
constraint, e.g. "composer require laravel-doctrine/orm:*" to figure
out if any version is installable, or "composer require
laravel-doctrine/orm:^2.1" if you know which you need.

doctrine-migrations does not support laravel 9 at yet. See this discussion
It will be supported after it upgrade to doctrine/migrations 3 in this Pull Request
So if you want to really install doctrine/migrations, you need to use Laravel 8 instead of laravel 9.
Otherwise, you need to wait untill that PR merged and released

SOLVED
Currently doctrine/migrations can be installed using this command
composer require laravel-doctrine/orm "^1.7" doctrine/inflector:"^1.4|^2.0"
after install the packages you can install migations with no problems
Note that version 1.7 must be specified in the command, since it does not appear explicitly in the documentation

Related

Conflict between packages in laravel

I'm trying to install two packages. The passport and the auth. The Auth is because the passport requires this package, but when trying to install the passport, it says that it already finds a version but that it is not active/installed because of a conflict with another package.
I have no idea, I did some tests here, but I couldn't solve it. I really need help
I'll leave my composer.json below
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2.5|^8.0",
"aws/aws-sdk-php": "^3.208",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3",
"kitetail/zttp": "^0.6.0",
"laracasts/flash": "^3.2",
"laravel/framework": "^7.29",
"laravel/tinker": "^2.5",
"laravel/ui": "2.4",
"maatwebsite/excel": "^3.1",
"timehunter/laravel-google-recaptcha-v2": "~1.0.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"lucascudo/laravel-pt-br-localization": "^1.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.3",
"phpunit/phpunit": "^8.5.8|^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
These are the errors/warnings you get when trying to install each package
composer require laravel/passport:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires laravel/passport ^10.4 -> satisfiable by laravel/passport[v10.4.0, v10.4.1, 10.x-dev].
- laravel/passport[v10.4.0, ..., 10.x-dev] require illuminate/auth ^8.37|^9.0 -> found illuminate/auth[v8.37.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev] but these were not loaded, likely because it conflicts with another require.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/passport:*" to figure out if any version is installable, or "composer require laravel/passport:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
composer require illuminate/auth ^8.37:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires illuminate/auth 8.37, found illuminate/auth[v8.37.0] but these were not loaded, likely because it conflicts with another require.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Laravel 8 Your requirements could not be resolved to an installable set of packages when running composer require laravel/passport

There are a lot of versions of this question floating around, but i haven't found any that deal with these specific packages.
I am trying to install laravel passport version 10 into my laravel 8 installation,
When running composer require laravel/passport i get the following response:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/passport[v10.0.1, ..., 10.x-dev] require illuminate/auth ^8.2 -> found illuminate/auth[v8.2.0, ..., 8.x-dev] but it conflicts with another require.
- laravel/passport v10.0.0 requires illuminate/auth ^8.0 -> found illuminate/auth[v8.0.0, ..., 8.x-dev] but it conflicts with another require.
- Root composer.json requires laravel/passport ^10.0 -> satisfiable by laravel/passport[v10.0.0, v10.0.1, 10.x-dev].
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
found illuminate/auth ^8.0 -> found illuminate/auth[v8.0.0, ..., 8.x-dev] <- I dont understand this part, does it have anything to do with having "minimum-stability": "dev" in my composer.json?
Anyways, here is my composer.json:
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fideloper/proxy": "^4.4.1",
"fruitcake/laravel-cors": "^2.0.3",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^9.0",
"laravel/passport": "^10.0",
"laravel/tinker": "^2.5|dev-develop",
"paragonie/random_compat": "2.*"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
EDIT 1:
I tried running composer require --no-update laravel/passport and when i run composer update I get the following error(i though it may provide extra info):
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/passport[v10.0.1, ..., 10.x-dev] require illuminate/support ^8.2 -> satisfiable by illuminate/support[v8.2.0, ..., 8.x-dev].
- laravel/passport v10.0.0 requires illuminate/support ^8.0 -> satisfiable by illuminate/support[v8.0.0, ..., 8.x-dev].
- Only one of these can be installed: illuminate/support[dev-master, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev], laravel/framework[dev-master]. laravel/framework replaces illuminate/support and thus
cannot coexist with it.
- laravel/framework 9.x-dev is an alias of laravel/framework dev-master and thus requires it to be installed too.
- Root composer.json requires laravel/framework ^9.0 -> satisfiable by laravel/framework[9.x-dev (alias of dev-master)].
- Root composer.json requires laravel/passport ^10.0 -> satisfiable by laravel/passport[v10.0.0, v10.0.1, 10.x-dev].
EDIT 2:
To further explain the answer below, you have to delete the vendor folder and composer.json file inside your project, the you run composer install to downgrade to laravel 8.
After that you can run composer require laravel/passport and it will install properly
Just simple do one thing
remove composer.lock file and then install your required package
It work for me...
Downgrade your Laravel version from 9 to 8
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fideloper/proxy": "^4.4.1",
"fruitcake/laravel-cors": "^2.0.3",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.0",
"laravel/passport": "^10.0",
"laravel/tinker": "^2.5|dev-develop",
"paragonie/random_compat": "2.*"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
I was able to solve this problem just by modifying the PHP PATH on my operating system, at the time I am using windows with WampServer.
The change suggested above may work, but if a composer install command is being run, it is because an App already exists and is just downloading its dependencies, so changing the file suggested above can cause problems in the operation of the Application.
I think that changing the PATH note to the correct PHP version will work, in my case:
C:\wamp64\bin\php\php7.3.21 worked.
Valew.
I vas trying to install barryvdh/laravel-ide-helper when I got this error. It required PHP 7.3+ and Laravel 8.0+ as described here, but I had lower versions. So here are the steps I followed:
Deleted composer.lock file
Changed the version of PHP and Laravel in composer.json
Ran composer install which creates a new composer.lock file
Then ran composer require barryvdh/laravel-ide-helper and it was installed successfully
Just delete composer.json and composer.lock files, and it will do the trick :)

Can't make "composer require laravel/ui --dev" on laravel 6.5.1

I am getting following error :
Can't make "composer require laravel/ui --dev" on laravel 6.5.1. I get an error
"Your requirements could not be resolved to an installable set of packages.
Problem 1:
Conclusion: remove laravel/framework v6.5.1
Conclusion: don't install laravel/framework v6.5.1
Installation failed, reverting ./composer.json to its original content.
In my composer.json
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.2",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^5.2.0",
"tcg/voyager": "^1.3"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"repositories": {
"hooks": {
"type": "composer",
"url": "https://larapack.io"
}
}
}
Php version 7.2.25
Please, help.
Version 2 of laravel/ui isn't compatible with version 6 of Laravel so installs the version 1 with composer require laravel/ui="1.*" --dev
The command to implement Auth is as follows:
composer require laravel/ui
php artisan ui vue --auth
OR
composer require laravel/ui --dev
php artisan ui vue --auth
If your Login and Register page only shows plain HTML. And CSS is not loading properly then run this two command:
npm install
npm run dev
Try this command, it worked for me:
$ composer require laravel/ui "^1.2"
composer require laravel/ui "^1.2" works...laravel 6 versions can only run
laravel/ui 1.2.0:
See Packagist for older versions
https://packagist.org/packages/laravel/ui#v1.2.0. ----------------------
Also check out laravel 6 docs
https://laravel.com/docs/6.x/frontend -----------------------
I faced the same issue with laravel 6.17. You can try to use this command instead :
composer require laravel/ui="1.*" - -dev
In my conclusion that laravel 6.x not compatible with laravel/ui version ^2.0. That command works for me.

composer global require fails where non global equivalent succeeds

Im developing a package available at packagist as user/package. Installing it locally works just fine
composer require user/package
Creating a new project is also fine
composer create-project --prefer-dist user/package new-project
But the package is to be deployed globally
composer global require user/package
however this results in the following error log.
Changed current directory to /home/anders/.composer ./composer.json
has been updated Loading composer repositories with package
information Updating dependencies (including require-dev) Your
requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for user/package ^v0.0.3 -> satisfiable by user/package[v0.0.3].
- Conclusion: remove illuminate/container v5.5.2
- Conclusion: don't install illuminate/container v5.5.2
- don't install tightenco/collect v5.4.33|don't install laravel/framework v5.5.2
- don't install laravel/framework v5.5.2|remove tightenco/collect v5.4.33
- Installation request for illuminate/container (installed at v5.5.2) -> satisfiable by illuminate/container[v5.5.2],
laravel/framework[v5.5.2].
- Installation request for tightenco/collect (installed at v5.4.33) -> satisfiable by tightenco/collect[v5.4.33].
Installation failed, reverting ./composer.json to its original
content.
How can this be?
I have tried composer global clearcache
Deleted a composer.lock file I found directly under /home/anders/.composer/
Upgraded my dependencies (Laravel) from 5.5.x to 5.6.x with no effect
Even creating a fresh "laravel new blog" project and uploading to packagist fails with the same error message.
Here is my composer.json
{
"name": "user/package",
"description": "Package",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"ajthinking/tinx": "^2.1",
"fideloper/proxy": "~3.3",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.5.*",
"laravel/tinker": "~1.0"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"bin": [
"package"
]
}
Would really appreciate help interpreting the error log. Thanks!
Update
This is the content of /home/anders/.composer/
{
"require": {
"cpriego/valet-linux": "^2.0",
"laravel/installer": "^1.4",
"phpunit/phpunit": "^6.4",
"phpunit/dbunit": "^3.0"
}
}
Composer version: 1.6.5
If this is standalone tool, you should consider building PHAR for it. You can use kherge/box to simplify build process.
PHAR archive is completely standalone, so you'll get rid of all problems with conflicting global dependencies. It may also simplify installation (you need to just download archive and make it executable) for both global and local installation.

i can not install laravel passport

composer require laravel/passport ^v1
result command
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
- Installation request for doctrine/instantiator (installed at 1.1.0) -> satisfiable by doctrine/instantiator[1.1.0].
Installation failed, reverting ./composer.json to its original content.
my composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.22",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"laravel/passport": "^1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
how can i solved it
Install php 7.1 and you will be fine.
For ubuntu
https://www.vultr.com/docs/how-to-install-and-configure-php-70-or-php-71-on-ubuntu-16-04
For windows
http://php.net/manual/en/install.windows.php
You have to update your php version to be 7, after that you have to re install your composer and make sure that it will take correct php version

Categories