Updating from Laravel 5.8 to 6.0 fails due to dependencies - laravel-6
I'm trying to update from 5.8 to any version 6 Laravel. I've updated the PHP code, but the composer update is problematic for me. I've tried composer update, composer update --with-dependencies, composer install.
Composer isn't something I work with often. Any help is very appreciate! How do I decipher the composer error message to an actionable task? Is there a command that will install the dependencies for Laravel 6?
The error message after composer update:
- Conclusion: don't install laravel/framework v6.0.0
- arcanedev/support 4.5.0 requires illuminate/support ~5.8.0 -> satisfiable by laravel/framework[v5.8.38], illuminate/support[5.8.x-dev, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9].
- arcanedev/support 4.5.0 requires illuminate/support ~5.8.0 -> satisfiable by laravel/framework[v5.8.38], illuminate/support[5.8.x-dev, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9].
- Can only install one of: laravel/framework[6.x-dev, v5.8.38].
- don't install illuminate/support 5.8.x-dev|don't install laravel/framework 6.x-dev
- don't install illuminate/support v5.8.9|don't install laravel/framework 6.x-dev
- Installation request for laravel/framework ^6.0 -> satisfiable by laravel/framework[6.x-dev, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1.0, v6.10.0, v6.10.1, v6.11.0, v6.12.0, v6.13.0, v6.13.1, v6.14.0, v6.15.0, v6.15.1, v6.16.0, v6.17.0, v6.17.1, v6.18.0, v6.18.1, v6.18.10, v6.18.11, v6.18.12, v6.18.13, v6.18.14, v6.18.15, v6.18.16, v6.18.17, v6.18.18, v6.18.19, v6.18.2, v6.18.20, v6.18.21, v6.18.22, v6.18.23, v6.18.24, v6.18.25, v6.18.26, v6.18.27, v6.18.28, v6.18.29, v6.18.3, v6.18.30, v6.18.31, v6.18.4, v6.18.5, v6.18.6, v6.18.7, v6.18.8, v6.18.9, v6.2.0, v6.3.0, v6.4.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0, v6.8.0, v6.9.0].
- Installation request for arcanedev/support ~4.5 -> satisfiable by arcanedev/support[4.5.0].
The composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"laravel/framework": "^6.0",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"illuminate/support": "~5.8.0|^6.0",
"intervention/image": "^2.4",
"laravel/tinker": "^1.0",
"spatie/laravel-permission": "^3.0"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.6",
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0",
"barryvdh/laravel-debugbar": "^3.2",
"arcanedev/log-viewer": "^4.7",
"arcanedev/support": "~4.5"
},
"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"
]
}
}
Just have a look at the error message you've shared: your configuration requires arcanedev/support with the version constraint ~4.5. By peeking into the version list of that package, you can see that there is only one version that can be used, which is 4.5.0, and this package requires illuminate/support with the version constraint ~5.8.0. Obviously, this excludes any later versions of Laravel.
By also updating arcanedev/support to some later version (^5.0 should be fine), you are able to update Laravel. Packagist can help you to inspect the constraints for different versions of that package.
Related
syntax error, unexpected '#', expecting variable (T_VARIABLE) or '{' or '$'
I'am using php 7.4.27, laravel framework 8.83.7 and installed Laravel Jetstream. Login & Register can show. After registered, Then an error notification appears in Laravel: syntax error, unexpected '#', expecting variable (T_VARIABLE) or '{' or '$' and in code line 12 : <?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'jetstream::components.dropdown-link','data' => ['href' => $href,'#click.prevent' => $#clickPrevent]]); ?> I won't update to php 8. What should i do? =====edited===== composer.json file : { "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { "php": "^7.3|^8.0", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^8.75", "laravel/jetstream": "^2.7", "laravel/sanctum": "^2.11", "laravel/tinker": "^2.5", "livewire/livewire": "^2.5" }, "require-dev": { "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", "laravel/sail": "^1.0.1", "mockery/mockery": "^1.4.4", "nunomaduro/collision": "^5.10", "phpunit/phpunit": "^9.5.10" }, "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 }, "minimum-stability": "dev", "prefer-stable": true }
Explanation: The issue comes from the fact that the compiled view version under storage/framework/views is failing to evaluate $#clickPrevent. <?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'jetstream::components.dropdown-link','data' => ['href' => $href,'#click.prevent' => $#clickPrevent]]); ?> This has nothing to do with your current PHP version. Solution: I managed to locally reproduce the issue. Here is how I solved it. Steps: Publish the Jetstream Livewire components. Command: php artisan vendor:publish --tag=jetstream-views Open the file resources/views/vendor/jetstream/components/switchable-team.blade.php In the file contents, Instead of: <x-dynamic-component :component="$component" href="#" #click.prevent="$root.submit();"> ❌ Use this: <x-dynamic-component :component="$component" href="#"> ✅ Disclaimer: Note that this is a temporary solution. Everything works fine for me. As lamented by #IMSoP in a comment, I'm afraid it may affect some unknown functionality. I've opened an issue against the library here: switchable-team.blade.php compiled Jetstream component throwing an error: syntax error, unexpected token "#", expecting variable or "{" or "$" Update 10th/April/2022: Another "more stable" solution stated by #fabpl on the opened Github issue: I think it's the same bug like [2.x] Fix parse error caused by alpine shorthand on dynamic-component #1032 Try to replace #click with x-on:click https://github.com/laravel/jetstream/issues/1036#issuecomment-1094253898 Addendum: The issue seems to have been introduced in laravel/jetstream v2.7.2. More specifically Use Alpine's #click.prevent for switching teams. The good news is that this has been resolved beginning from laravel/jetstream v2.7.3 onwards. More specifically [2.x] Fix parse error caused by alpine shorthand on dynamic-component. I just tagged v2.7.3 which should fix this. Thanks all 👍 https://github.com/laravel/jetstream/issues/1036#issuecomment-1094332998 Hence, you may simply just upgrade your Jetstream version to v2.7.3 to get the fix. I.e: Command: composer update laravel/jetstream:2.7.3 Sample Output: PS C:\Users\Ivan\Documents\SteveContents\GITHUB\Laravel-8.83.7\laravel-8.83.7> composer update laravel/jetstream:2.7.3 Loading composer repositories with package information Info from https://repo.packagist.org: #StandWithUkraine Updating dependencies Lock file operations: 0 installs, 1 update, 0 removals - Upgrading laravel/jetstream (v2.7.2 => v2.7.3) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 0 removals - Downloading laravel/jetstream (v2.7.3) - Downloading laravel/jetstream (v2.7.3) - Downloading laravel/jetstream (v2.7.3) - Downloading laravel/jetstream (v2.7.3) - Upgrading laravel/jetstream (v2.7.2 => v2.7.3): Extracting archive ...
Laravel 8.x to 9.x upgrade requirements issue
How can I fix? Your requirements could not be resolved to an installable set of packages. illuminate/database[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.1.2) does not satisfy that requirement. illuminate/database[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.1.2) does not satisfy that requirement. illuminate/database[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.1.2) does not satisfy that requirement. Root composer.json requires spatie/laravel-permission ^4.2 -> satisfiable by spatie/laravel-permission[4.2.0, ..., v4.x-dev]. Conclusion: don't install laravel/framework v9.0.0-beta.2 (conflict analysis result) Conclusion: don't install laravel/framework v9.0.0-beta.3 (conflict analysis result) Conclusion: don't install laravel/framework v9.0.0-beta.4 (conflict analysis result) Conclusion: don't install laravel/framework v9.0.0-beta.5 (conflict analysis result) Conclusion: don't install laravel/framework v9.0.0 (conflict analysis result) Conclusion: don't install laravel/framework v9.0.1 (conflict analysis result) Conclusion: don't install laravel/framework v9.0.2 (conflict analysis result) Conclusion: don't install laravel/framework v9.1.0 (conflict analysis result) Conclusion: don't install laravel/framework v9.2.0 (conflict analysis result) Conclusion: don't install laravel/framework v9.3.0 (conflict analysis result) Conclusion: don't install laravel/framework v9.3.1 (conflict analysis result) Conclusion: don't install laravel/framework v9.0.0-beta.1 (conflict analysis result) spatie/laravel-permission[4.2.0, ..., v4.x-dev] require illuminate/database ^6.0|^7.0|^8.0 -> satisfiable by illuminate/database[v6.0.0, ..., 6.x-dev, v7. 0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev]. Only one of these can be installed: illuminate/database[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev], laravel/framework[v9.0.0-beta.1 , ..., 9.x-dev]. laravel/framework replaces illuminate/database and thus cannot coexist with it. Root composer.json requires laravel/framework ^9.0 -> satisfiable by laravel/framework[v9.0.0-beta.1, ..., 9.x-dev].
Take backup of your old composer.json, just to refer for all the other packages that you are going to need. Remove vendor folder and copy composer.json from below. This is my fresh laravel 9 composer.json file { "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { "php": "^8.0.2", "guzzlehttp/guzzle": "^7.2", "laravel/framework": "^9.2", "laravel/sanctum": "^2.14.1", "laravel/tinker": "^2.7", "spatie/laravel-permission": "^5.5" }, "require-dev": { "fakerphp/faker": "^1.9.1", "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 }, "minimum-stability": "dev", "prefer-stable": true } Then run composer update After that if you want your old packages back then install one by one like this composer require spatie/laravel-permission
Error assert(): assert(sizeof($failures) == 1) failed stops Codeception Test
At some point, while adding assertions for my test, I got the following error message during a test run which stops the execution of the test Testing started at 14:28 ... C:\xampp\php\php.exe C:/Users/georg/AppData/Local/Temp/ide-codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-interaction -c C:/Users/georg/Documents/CMS_Automation_Tests/codeception.yml "tests\regression\features\ArticleTests.feature:Create a new article and fill out all available fields" Codeception PHP Testing Framework v4.1.7 Powered by PHPUnit 9.3.8 by Sebastian Bergmann and contributors. Running with seed: In ErrorHandler.php line 83: assert(): assert(sizeof($failures) == 1) failed run [-o|--override OVERRIDE] [-e|--ext EXT] [--report] [--html [HTML]] [--xml [XML]] [--phpunit-xml [PHPUNIT-XML]] [--tap [TAP]] [--json [JSON]] [--colors] [--no-colors] [--silent] [--steps] [-d|--debug] [--bootstrap [BOOTSTRAP]] [--no-redirect] [--coverage [COVERAGE]] [--coverage-html [COVERAGE-HTML]] [--coverage-xml [COVERAGE-XML]] [--coverage-text [COVERAGE-TEXT]] [--coverage-crap4j [COVERAGE-CRAP4J]] [--coverage-phpunit [COVERAGE-PHPUNIT]] [--no-exit] [-g|--group GROUP] [-s|--skip SKIP] [-x|--skip-group SKIP-GROUP] [--env ENV] [-f|--fail-fast] [--no-rebuild] [--seed SEED] [--no-artifacts] [--] [<suite> [<test>]] I didn't find any information about this error. It doesn't seem to be related to any specific error in my code. My composer.json is below: { "name": "cms/automation", "type": "project", "require": { "php": "^7.2", "ext-json": "*", "fzaninotto/faker": "^1.7", "php-webdriver/webdriver": "^1.8#dev", "ext-curl": "*", "ext-zip": "*", "ext-mb$ vendor/bin/behat -V\nstring": "*", "facebook/webdriver": "1.7" }, "require-dev": { "phpunit/phpunit": "^6.5", "mockery/mockery": "~0.9", "codeception/codeception": "^4.1", "codeception/base": "^2.4", "symfony/var-dumper": "^4.1", "behat/behat": "^3.6" }, "autoload": { "psr-4": { "App\\": "app/" } }, "autoload-dev": { "classmap": [ "tests/" ] }, "minimum-stability": "dev", "prefer-stable": true }
How to install Aurelia UX 0.4.0 with Aurelia CLI?
I’ve been using aurelia-ux 0.3.0 for some time now and love the concept. Since the move to aurelia-ux 0.4.0 and the shift to monorepo I’m a little lost on how to install and use the library. Could anyone provide a little exemple on how to install aurelia-ux 0.4.0 (core + 1-2 components) with aurelia-cli ? Notice: the current npm documentation of #aurelia-ux/core package points to the showcase application - however this showcase still runs 0.3.0.
After some tests and research I've been able to install auralia-ux 0.4.0+ First you need to install the core and components npm install #aurelia-ux/core Then you can either install each component separately or together npm install #aurelia-ux/button npm install #aurelia-ux/input npm install #aurelia-ux/... # or npm install #aurelia-ux/components Then in the aurelia_project/aurelia.json you need to add the dependencies as such: { "name": "#aurelia-ux/core", "path": "../node_modules/#aurelia-ux/core/dist/amd", "main": "index", "resources": [ "**/*.{css,html}" ] }, { "name": "#aurelia-ux/button", "path": "../node_modules/#aurelia-ux/button/dist/amd", "main": "index", "resources": [ "**/*.{css,html}" ] }, { "name": "#aurelia-ux/input", "path": "../node_modules/#aurelia-ux/input/dist/amd", "main": "index", "resources": [ "**/*.{css,html}" ] }, or if you prefer the components variant (warning: I haven't tested this variant): { "name": "#aurelia-ux/core", "path": "../node_modules/#aurelia-ux/core/dist/amd", "main": "index", "resources": [ "**/*.{css,html}" ] }, { "name": "#aurelia-ux/components", "path": "../node_modules/#aurelia-ux/components/dist/amd", "main": "index", "resources": [ "**/*.{css,html}" ] } Finaly you must register the plugins in your main.js aurelia.use .plugin('#aurelia-ux/core') .plugin('#aurelia-ux/button') .plugin('#aurelia-ux/input') or with the components variant (not tested) aurelia.use .plugin('#aurelia-ux/core') .plugin('#aurelia-ux/components')
Browserify-shim not reading a transform from the package.json
I am trying to use browserify to build a new project that my team is working on, but it does not recognize the transform from the package.json. It will build on 2 machines, but on 2 others it will not build. Here is the relevant piece of my package.json. "dependencies": {}, "devDependencies": { .... }, "browserify": { "transform": [ "browserify-shim" ] }, "browser": { "angular": "./src/main/webapp/js/lib/angular.js", "angular-route": "./src/main/webapp/js/lib/angular-route.js", "underscore": "./src/main/webapp/js/lib/lodash.compat.js", "restangular": "./src/main/webapp/js/lib/restangular.js" }, "browserify-shim": { "angular": {}, "angular-route": { "depends": [ "angular" ] }, "underscore": { "exports": "_" }, "restangular": { "depends": [ "underscore", "angular" ] } } I am running browserify from the command line. I have 4 computers on my team and it is working on a Mac and a Windows machine, but I have 2 Windows machine that it does not work on. We have all pulled from the same repo, all of our browserify and npm versions are the same. What should I do next?
The Windows machines were running the command from git bash. The command would not work with on git bash. After we switched to the command prompt, then all of the commands run fine.