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

[Composer] Unable to install with Composer 2 #439

Closed
ker0x opened this issue Oct 29, 2020 · 7 comments
Closed

[Composer] Unable to install with Composer 2 #439

ker0x opened this issue Oct 29, 2020 · 7 comments
Labels

Comments

@ker0x
Copy link

ker0x commented Oct 29, 2020

Hello,

When running composer create-project sylius/sylius-standard MyFirstShop I got this error:

Creating a "sylius/sylius-standard" project at "./MyFirstShop"
Installing sylius/sylius-standard (v1.8.0)
  - Installing sylius/sylius-standard (v1.8.0): Extracting archive
Created project in /home/ker0x/dev/MyFirstShop
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - ocramius/package-versions is locked to version 1.5.1 and an update of this package was not requested.
    - ocramius/package-versions 1.5.1 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - ocramius/package-versions 1.5.1 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - symplify/easy-coding-standard v8.1.19 requires ocramius/package-versions ^1.4 -> satisfiable by ocramius/package-versions[1.5.1].
    - symplify/easy-coding-standard is locked to version v8.1.19 and an update of this package was not requested.

ocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.
If you can not upgrade PHP you can require composer/package-versions-deprecated to resolve this with PHP 7.0+.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

PHP version: 7.4.11
Composer version: 2.0.2
Ubuntu version: Ubuntu 20.04.1 LTS

@ker0x ker0x changed the title [Composer] Unable to install wih Composer 2 [Composer] Unable to install with Composer 2 Oct 29, 2020
@arjanfrans
Copy link

You have to run composer update. However, after updating I got another problem:

[2020-11-03 13:00:30] request.CRITICAL: Exception thrown when handling an exception (Symfony\Component\Config\Exception\LoaderLoadException: Cannot find a field on 'App\Entity\Channel\ChannelPricing' that is mapped to column 'channelCode'. Either the field does not exist or an association exists but it has multiple join columns in . (which is being imported from "/var/www/app/vendor/sylius/sylius/src/Sylius/Bundle/ApiBundle/Resources/config/routing.yml"). Make sure there is a loader supporting the "api_platform" type. at /var/www/app/vendor/symfony/config/Loader/FileLoader.php line 180) {"exception":"[object] (Symfony\\Component\\Config\\Exception\\LoaderLoadException(code: 0): Cannot find a field on 'App\\Entity\\Channel\\ChannelPricing' that is mapped to column 'channelCode'. Either the field does not exist or an association exists but it has multiple join columns in . (which is being imported from \"/var/www/app/vendor/sylius/sylius/src/Sylius/Bundle/ApiBundle/Resources/config/routing.yml\"). Make sure there is a loader supporting the \"api_platform\" type. at /var/www/app/vendor/symfony/config/Loader/FileLoader.php:180, Doctrine\\ORM\\Mapping\\MappingException(code: 0): Cannot find a field on 'App\\Entity\\Channel\\ChannelPricing' that is mapped to column 'channelCode'. Either the field does not exist or an association exists but it has multiple join columns. at /var/www/app/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/MappingException.php:621)"} []

Can you try to update composer, and see if it works?

@ker0x
Copy link
Author

ker0x commented Nov 3, 2020

Running composer update solved the first issue, but same as you, I got this error too:

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  
!!   // Clearing the cache for the dev environment with debug                       
!!   // true                                                                        
!!  
!!  
!!  In FileLoader.php line 180:
!!                                                                                 
!!    Cannot find a field on 'App\Entity\Channel\ChannelPricing' that is mapped t  
!!    o column 'channelCode'. Either the field does not exist or an association e  
!!    xists but it has multiple join columns in . (which is being imported from "  
!!    /home/ker0x/dev/sylius-standard/vendor/sylius/sylius/src/Sylius/Bundle/ApiB  
!!    undle/Resources/config/routing.yml"). Make sure there is a loader supportin  
!!    g the "api_platform" type.                                                   
!!                                                                                 
!!  
!!  In MappingException.php line 621:
!!                                                                                 
!!    Cannot find a field on 'App\Entity\Channel\ChannelPricing' that is mapped t  
!!    o column 'channelCode'. Either the field does not exist or an association e  
!!    xists but it has multiple join columns.                                      
!!                                                                                 
!!  

@arjanfrans
Copy link

For now I just downgraded to composer 1: composer self-update --1

@lchrusciel
Copy link
Member

Hey folks,

one issue is done by ocramius/package-version and it is not we can do much about, or we need more information, but #428 will solve this issue. Database error should be fixed with: https://github.com/Sylius/Sylius/releases/tag/v1.8.4

@lchrusciel
Copy link
Member

Can you test with the new Sylius-Standard release? https://github.com/Sylius/Sylius-Standard/releases/tag/v1.8.1

@ker0x
Copy link
Author

ker0x commented Nov 12, 2020

Hello @lchrusciel

The new release fix the issue, I was able to fully create a project 👍

@lchrusciel
Copy link
Member

I'm glad to hear that :D

@pamil pamil closed this as completed Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants