Brent
Brent

Reputation: 2485

Composer Update Laravel

A developer has sent me his project to work with, but when ever I try to update or install my vendors everything works great until the very end and it outputs the message bellow.

C:\xampp\htdocs\BigWaveMedia\davinkit>php artisan migrate
{
    "error": {
        "type": "Exception",
        "message": "expected color value: failed at `.clearfix;` C:\\xampp\\htdocs\\BigWaveMedia\\davinkit\\app\\start\/..\/..\/public\/less\/style.less on line 102",
        "file": "C:\\xampp\\htdocs\\davinkit\\vendor\\leafo\\lessphp\\lessc.inc.php",
        "line": 3258
    }
}
C:\xampp\htdocs\BigWaveMedia\davinkit>

Any ideas at all? Here is a full log http://pastebin.com/y9q4Rc5z

Upvotes: 35

Views: 309762

Answers (5)

Darshana Sangwan
Darshana Sangwan

Reputation: 1

You can use :

composer self-update --2

To update to 2.0.8 version (Latest stable version)

Upvotes: -2

MDI
MDI

Reputation: 27

write this command in your terminal :

composer update

Upvotes: -1

hassan shaikh
hassan shaikh

Reputation: 41

this is command for composer update please try this...

composer self-update

Upvotes: 2

Ghulam Akbar
Ghulam Akbar

Reputation: 549

The following works for me:

composer update --no-scripts

Upvotes: 33

Kryten
Kryten

Reputation: 15740

When you run composer update, composer generates a file called composer.lock which lists all your packages and the currently installed versions. This allows you to later run composer install, which will install the packages listed in that file, recreating the environment that you were last using.

It appears from your log that some of the versions of packages that are listed in your composer.lock file are no longer available. Thus, when you run composer install, it complains and fails. This is usually no big deal - just run composer update and it will attempt to build a set of packages that work together and write a new composer.lock file.

However, you're running into a different problem. It appears that, in your composer.json file, the original developer has added some pre- or post- update actions that are failing, specifically a php artisan migrate command. This can be avoided by running the following: composer update --no-scripts

This will run the composer update but will skip over the scripts added to the file. You should be able to successfully run the update this way.

However, this does not solve the problem long-term. There are two problems:

  1. A migration is for database changes, not random stuff like compiling assets. Go through the migrations and remove that code from there.

  2. Assets should not be compiled each time you run composer update. Remove that step from the composer.json file.

From what I've read, best practice seems to be compiling assets on an as-needed basis during development (ie. when you're making changes to your LESS files - ideally using a tool like gulp.js) and before deployment.

Upvotes: 66

Related Questions