0

I require a dependency on my local environment. I add it's service provider and all is fine. The composer.json has this script

"pre-update-cmd": [
            "php artisan clear-compiled"
        ],

When I push the changes to production, I try to run composer update but because of that script artisan fails with an error since the dependency is not yet installed and therefore the service provider I added in config/app.php is not there yet.

What is the best approach to situations like this? Just remove the pre-update script?

Cristian
  • 2,390
  • 6
  • 27
  • 40

2 Answers2

0

Hmmm interesting problem

  1. What are you typing in for the service provider in your app.php
  2. Have you tried removing your service provider and then running composer update and re-adding it after the dependencies have installed?
  • Also, what dependency are you trying to install? – Derick Vigne Mar 06 '16 at 16:21
  • Well. It works if I remove the service provider from app.php. But the issue is how do I get past this. I am wondering how to deal with a new dependency that needs to get installed on the production server as well. Removing the pre-update-cmd solves my issue but I don't understand why it was included in the composer.json by Taylor Otwell. It does not make sense to run an artisan command before you actually update the dependencies. – Cristian Mar 06 '16 at 17:15
0

Interesting problem,

Please check your json file with

composer validate from your working directory.

INDIAN2025
  • 191
  • 2
  • 6