OFFLINE-GmbH / oc-bootstrapper

Easily bootstrap a new October CMS project
MIT License
82 stars 25 forks source link

Error using "php composer.phar install --no-interaction --no-dev --prefer-dist --ignore-platform-reqs" #29

Open obuchmann opened 5 years ago

obuchmann commented 5 years ago

When installing october command via composer as suggested in the Envoy.blade.php template.

Uses php composer.phar install --no-interaction --no-dev --prefer-dist --ignore-platform-reqs

I'm getting an error invoking the october command via ./vendor/bin/october -v

PHP Fatal error:  Uncaught Error: Class 'OFFLINE\Bootstrapper\October\Console\InitCommand' not found in <project_path>/vendor/offline/oc-bootstrapper/october:12
Stack trace:
#0 {main}
  thrown in <project_path>/vendor/offline/oc-bootstrapper/october on line 12

when I skip the composer flags --no-dev --prefer-dist everything works.

alxy commented 5 years ago

I have also commented this line out - because composer install is also ran by october install itself. Is there any reason why this is included in the deploy script (again)?

tobias-kuendig commented 5 years ago

You are right, this is kind of duplicated. The first composer install is run so oc-bootstrapper is available in the vendor directory on the next line (this is only needed for the first deployment).

I guess we can change this to a

php composer.phar require offline/oc-bootstrapper --no-interaction --prefer-dist --ignore-platform-reqs
php ./vendor/bin/october install

I have also experienced the above error before. Running composer require offline/oc-bootstrapper resolved the issue. I wonder what the --prefer-dist flag does differently. Also, I wonder why we are able to run the install command and only the init command is missing :thinking:

obuchmann commented 5 years ago

--prefer-dist resolves the issue of China errors Form using a different php version than specified in composer.json. Octobercms points to php 7.0 per default. It has no impact in this issue.

I tracked the error to the --no-dev flag. Maybe there is a oc-bootstrapper version in the cm repository that is broken and a version with the dev flag that is working?