UltimateModuleCreator / umc

Magento 2 Ultimate Module Creator
MIT License
58 stars 10 forks source link

Fatal Error: composer.lock was created for PHP version 7.4 #51

Closed srenon closed 4 years ago

srenon commented 4 years ago

Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.17.

Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!  Fatal Error: composer.lock was created for PHP version 7.4 or higher but the current PHP version is 7.3.17.
!!  
Script @auto-scripts was called via post-install-cmd
UltimateModuleCreator commented 4 years ago

@srenon thanks for reporting this. Will investigate and report back as soon as possible

srenon commented 4 years ago

@UltimateModuleCreator .. I'm using this workaround for now

composer dump-autoload
composer install

$ composer dump-autoload Generating autoload files Generated autoload files $ composer install Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating autoload files 39 packages you are using are looking for funding. Use the composer fund command to find out more! Executing script cache:clear [OK] Executing script assets:install . [OK]

See https://stackoverflow.com/questions/59141344/fatal-error-composer-lock-was-created-for-php-version-7-4-or-higher-but-the-cur

srenon commented 4 years ago

@UltimateModuleCreator ... should PHP version lock to 7.4? If I do:

  1. git checkout .
  2. change symfony.lock version number to 7.3
  3. delete the vendor folder
  4. composer install

then it will work without any issue

https://github.com/UltimateModuleCreator/umc/blob/master/symfony.lock#L21

"php": {
     "version": "7.4"
},
UltimateModuleCreator commented 4 years ago

@srenon This app should work for any php version starting from 7.2.5. You can change your version in symfony.lock. I will try to find a solution today so you don't have to change anything. Or at least include some extra steps in the install process.

UltimateModuleCreator commented 4 years ago

@srenon I added symfony.lock to .gitignore this looks like it solves the problem. Can you confirm?