laravel/framework[v10.0.0, …, v10.1.5] cannot be installed as that would require removing laravel/laravel[dev-master]

huangapple go评论90阅读模式
英文:

laravel/framework[v10.0.0, ..., v10.1.5] cannot be installed as that would require removing laravel/laravel[dev-master]

问题

I'm trying to upgrade my Laravel app from version 9 to 10. After making the necessary changes to the composer.json file, I encountered the following error:

  1. Your requirements could not be resolved to an installable set of packages.
  2. Problem 1
  3. - laravel/framework[v10.0.0, ..., v10.1.5] cannot be installed as that would require removing laravel/laravel[dev-master]. They all replace illuminate/support and thus cannot coexist.
  4. - laravel/laravel is present at version dev-master and cannot be modified by Composer
  5. - Root composer.json requires laravel/framework ^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., v10.1.5].

What am I doing wrong?

EDIT: I am running composer update.

Here is my full composer.json if someone is interested:

  1. {
  2. "name": "laravel/laravel",
  3. "description": "The Laravel Framework.",
  4. "keywords": ["framework", "laravel"],
  5. "minimum-stability": "stable",
  6. "license": "MIT",
  7. "type": "project",
  8. "require": {
  9. "php": ">= 8.1",
  10. "doctrine/dbal": "^3.0",
  11. "fakerphp/faker": "^1.9.1",
  12. "fruitcake/php-cors": "^1.2",
  13. "guzzlehttp/guzzle": "^7.4",
  14. "kylekatarnls/laravel-carbon-2": "^1.0.0",
  15. "laravel/framework": "^10.0",
  16. "laravel/helpers": "^1.2",
  17. "laravel/tinker": "^2.0",
  18. "laravelcollective/html": "^6.0",
  19. "nesbot/carbon": "^2.5",
  20. "sentry/sentry-laravel": "^3.0",
  21. "srmklive/paypal": "~3.0",
  22. "stripe/stripe-php": "^7.0.0",
  23. "symfony/console": "^6.2",
  24. "symfony/error-handler": "^6.2",
  25. "symfony/finder": "^6.2",
  26. "symfony/http-foundation": "^6.2",
  27. "symfony/http-kernel": "^6.2",
  28. "symfony/mailer": "^6.2",
  29. "symfony/mime": "^6.2",
  30. "symfony/process": "^6.2",
  31. "symfony/routing": "^6.2",
  32. "symfony/uid": "^6.2",
  33. "symfony/var-dumper": "^6.2"
  34. },
  35. "replace": {
  36. "illuminate/support": "self.version"
  37. },
  38. "require-dev": {
  39. "mockery/mockery": "^1.4.1",
  40. "nunomaduro/collision": "^7.0",
  41. "phpunit/phpunit": "^10.0"
  42. },
  43. "autoload": {
  44. "classmap": [
  45. "database"
  46. ],
  47. "psr-4": {
  48. "App\\": "app/"
  49. },
  50. "files": [
  51. "app/Helpers/Helper.php",
  52. "src/Illuminate/Support/helpers.php"
  53. ]
  54. },
  55. "autoload-dev": {
  56. "psr-4": {
  57. "Tests\\": "tests/"
  58. }
  59. },
  60. "scripts": {
  61. "post-root-package-install": [
  62. "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
  63. ],
  64. "post-create-project-cmd": [
  65. "php artisan key:generate"
  66. ],
  67. "post-install-cmd": [
  68. "Illuminate\\Foundation\\ComposerScripts::postInstall",
  69. "php artisan optimize"
  70. ],
  71. "post-update-cmd": [
  72. "Illuminate\\Foundation\\ComposerScripts::postUpdate"
  73. ]
  74. },
  75. "config": {
  76. "preferred-install": "dist",
  77. "sort-packages": true,
  78. "optimize-autoloader": true,
  79. "allow-plugins": {
  80. "pestphp/pest-plugin": true
  81. }
  82. }
  83. }

Hope this helps!

英文:

Trying to upgrade my laravel app to 10 from 9. Getting this error after the changes required in composer json. Normally I know how to fix these types of errors since most of the time there is a package that you forgot to update. But from this error msg I can't really figure out what to do?

  1. Your requirements could not be resolved to an installable set of packages.
  2. Problem 1
  3. - laravel/framework[v10.0.0, ..., v10.1.5] cannot be installed as that would require removing laravel/laravel[dev-master]. They all replace illuminate/support and thus cannot coexist.
  4. - laravel/laravel is present at version dev-master and cannot be modified by Composer
  5. - Root composer.json requires laravel/framework ^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., v10.1.5].

What am i doing wrong?

EDIT: I am running composer update

Here is my full composer.json if someone is interested:

  1. {
  2. "name": "laravel/laravel",
  3. "description": "The Laravel Framework.",
  4. "keywords": ["framework", "laravel"],
  5. "minimum-stability": "stable",
  6. "license": "MIT",
  7. "type": "project",
  8. "require": {
  9. "php": ">= 8.1",
  10. "doctrine/dbal": "^3.0",
  11. "fakerphp/faker": "^1.9.1",
  12. "fruitcake/php-cors": "^1.2",
  13. "guzzlehttp/guzzle": "^7.4",
  14. "kylekatarnls/laravel-carbon-2": "^1.0.0",
  15. "laravel/framework": "^10.0",
  16. "laravel/helpers": "^1.2",
  17. "laravel/tinker": "^2.0",
  18. "laravelcollective/html": "^6.0",
  19. "nesbot/carbon": "^2.5",
  20. "sentry/sentry-laravel": "^3.0",
  21. "srmklive/paypal": "~3.0",
  22. "stripe/stripe-php": "^7.0.0",
  23. "symfony/console": "^6.2",
  24. "symfony/error-handler": "^6.2",
  25. "symfony/finder": "^6.2",
  26. "symfony/http-foundation": "^6.2",
  27. "symfony/http-kernel": "^6.2",
  28. "symfony/mailer": "^6.2",
  29. "symfony/mime": "^6.2",
  30. "symfony/process": "^6.2",
  31. "symfony/routing": "^6.2",
  32. "symfony/uid": "^6.2",
  33. "symfony/var-dumper": "^6.2"
  34. },
  35. "replace": {
  36. "illuminate/support": "self.version"
  37. },
  38. "require-dev": {
  39. "mockery/mockery": "^1.4.1",
  40. "nunomaduro/collision": "^7.0",
  41. "phpunit/phpunit": "^10.0"
  42. },
  43. "autoload": {
  44. "classmap": [
  45. "database"
  46. ],
  47. "psr-4": {
  48. "App\\": "app/"
  49. },
  50. "files": [
  51. "app/Helpers/Helper.php",
  52. "src/Illuminate/Support/helpers.php"
  53. ]
  54. },
  55. "autoload-dev": {
  56. "psr-4": {
  57. "Tests\\": "tests/"
  58. }
  59. },
  60. "scripts": {
  61. "post-root-package-install": [
  62. "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
  63. ],
  64. "post-create-project-cmd": [
  65. "php artisan key:generate"
  66. ],
  67. "post-install-cmd": [
  68. "Illuminate\\Foundation\\ComposerScripts::postInstall",
  69. "php artisan optimize"
  70. ],
  71. "post-update-cmd": [
  72. "Illuminate\\Foundation\\ComposerScripts::postUpdate"
  73. ]
  74. },
  75. "config": {
  76. "preferred-install": "dist",
  77. "sort-packages": true,
  78. "optimize-autoloader": true,
  79. "allow-plugins": {
  80. "pestphp/pest-plugin": true
  81. }
  82. }
  83. }

答案1

得分: 0

这是你提供的 JSON 文件的翻译部分:

  1. {
  2. "name": "laravel/laravel",
  3. "description": "Laravel 框架。",
  4. "keywords": ["框架", "laravel"],
  5. "license": "MIT",
  6. "type": "项目",
  7. "require": {
  8. "php": "^8.1",
  9. "guzzlehttp/guzzle": "^7.2",
  10. "laravel/framework": "^10.0",
  11. "laravel/sanctum": "^3.2",
  12. "laravel/tinker": "^2.8",
  13. "laravel/ui": "^4.2",
  14. "laravelcollective/html": "^6.4",
  15. "sentry/sentry-laravel": "3.*",
  16. "srmklive/paypal": "~3.0",
  17. "stripe/stripe-php": "^7.0.0",
  18. "symfony/http-client": "^6.1",
  19. "symfony/mailgun-mailer": "^6.1",
  20. "symfony/postmark-mailer": "^6.1"
  21. },
  22. "require-dev": {
  23. "fakerphp/faker": "^1.9.1",
  24. "laravel/dusk": "^7.7",
  25. "mockery/mockery": "^1.4.4",
  26. "laravel/pint": "^1.0",
  27. "laravel/sail": "^1.18",
  28. "nunomaduro/collision": "^7.0",
  29. "pestphp/pest": "^2.0",
  30. "pestphp/pest-plugin-laravel": "^2.0",
  31. "spatie/laravel-ignition": "^2.0"
  32. },
  33. "autoload": {
  34. "classmap": [
  35. "database"
  36. ],
  37. "psr-4": {
  38. "App\\": "app/"
  39. },
  40. "files": [
  41. "app/Helpers/Helper.php"
  42. ]
  43. },
  44. "autoload-dev": {
  45. "psr-4": {
  46. "Tests\\": "tests/"
  47. }
  48. },
  49. "scripts": {
  50. "post-root-package-install": [
  51. "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
  52. ],
  53. "post-create-project-cmd": [
  54. "php artisan key:generate"
  55. ],
  56. "post-install-cmd": [
  57. "Illuminate\\Foundation\\ComposerScripts::postInstall",
  58. "php artisan optimize"
  59. ],
  60. "post-update-cmd": [
  61. "Illuminate\\Foundation\\ComposerScripts::postUpdate"
  62. ]
  63. },
  64. "config": {
  65. "preferred-install": "dist",
  66. "sort-packages": true,
  67. "optimize-autoloader": true,
  68. "allow-plugins": {
  69. "pestphp/pest-plugin": true,
  70. "php-http/discovery": true
  71. }
  72. }
  73. }
英文:

I ended up comparing a little with the most current laravel composer.json file and ended up with this:

  1. {
  2. "name": "laravel/laravel",
  3. "description": "The Laravel Framework.",
  4. "keywords": ["framework", "laravel"],
  5. "license": "MIT",
  6. "type": "project",
  7. "require": {
  8. "php": "^8.1",
  9. "guzzlehttp/guzzle": "^7.2",
  10. "laravel/framework": "^10.0",
  11. "laravel/sanctum": "^3.2",
  12. "laravel/tinker": "^2.8",
  13. "laravel/ui": "^4.2",
  14. "laravelcollective/html": "^6.4",
  15. "sentry/sentry-laravel": "3.*",
  16. "srmklive/paypal": "~3.0",
  17. "stripe/stripe-php": "^7.0.0",
  18. "symfony/http-client": "^6.1",
  19. "symfony/mailgun-mailer": "^6.1",
  20. "symfony/postmark-mailer": "^6.1"
  21. },
  22. "require-dev": {
  23. "fakerphp/faker": "^1.9.1",
  24. "laravel/dusk": "^7.7",
  25. "mockery/mockery": "^1.4.4",
  26. "laravel/pint": "^1.0",
  27. "laravel/sail": "^1.18",
  28. "nunomaduro/collision": "^7.0",
  29. "pestphp/pest": "^2.0",
  30. "pestphp/pest-plugin-laravel": "^2.0",
  31. "spatie/laravel-ignition": "^2.0"
  32. },
  33. "autoload": {
  34. "classmap": [
  35. "database"
  36. ],
  37. "psr-4": {
  38. "App\\": "app/"
  39. },
  40. "files": [
  41. "app/Helpers/Helper.php"
  42. ]
  43. },
  44. "autoload-dev": {
  45. "psr-4": {
  46. "Tests\\": "tests/"
  47. }
  48. },
  49. "scripts": {
  50. "post-root-package-install": [
  51. "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
  52. ],
  53. "post-create-project-cmd": [
  54. "php artisan key:generate"
  55. ],
  56. "post-install-cmd": [
  57. "Illuminate\\Foundation\\ComposerScripts::postInstall",
  58. "php artisan optimize"
  59. ],
  60. "post-update-cmd": [
  61. "Illuminate\\Foundation\\ComposerScripts::postUpdate"
  62. ]
  63. },
  64. "config": {
  65. "preferred-install": "dist",
  66. "sort-packages": true,
  67. "optimize-autoloader": true,
  68. "allow-plugins": {
  69. "pestphp/pest-plugin": true,
  70. "php-http/discovery": true
  71. }
  72. }
  73. }

huangapple
  • 本文由 发表于 2023年2月26日 21:17:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/75572247.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定