oc-bootstrapper icon indicating copy to clipboard operation
oc-bootstrapper copied to clipboard

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

Open obuchmann opened this issue 5 years ago • 3 comments

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.

obuchmann avatar Apr 29 '19 10:04 obuchmann

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)?

alxy avatar Apr 29 '19 18:04 alxy

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:

tobias-kuendig avatar Apr 30 '19 05:04 tobias-kuendig

--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?

obuchmann avatar Apr 30 '19 05:04 obuchmann