Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 356
Brent Avatar asked Jul 16 '14 14:07

Brent


People also ask

What is composer update in Laravel?

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.

How do I update my composer?

For updating your Composer, you need to open the terminal (if you have a global installation) and run one of the following commands: Use composer self-update --preview to try the latest RC version (2. x). Use composer self-update --snapshot to try the latest dev build (2.

How can I update my Laravel version?

The recommended method of upgrading is to create a new Laravel 5.0 install and then to copy your 4.2 site's unique application files into the new application. This would include controllers, routes, Eloquent models, Artisan commands, assets, and other code specific to your application.


1 Answers

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.

like image 126
Kryten Avatar answered Sep 30 '22 10:09

Kryten