Lando + Composer FTW

<p><span class="drop-cap">I</span> feel I'm having one of those "DUH! Of course!" moments right now.</p> <p>I've been doing updates for years, and cursing every time this happened to me. I have to run a simple command: <code>composer update drupal/core "drupal/core-*" --with-all-dependencies</code></p> <p>We work locally with lando, and use composer within lando as well, so the command would change to: <code>lando composer ...</code></p> <p>So far so good, worked very well.</p> <p>But sometimes, the dreadful message came:</p> <pre> <code class="language-bash">Your requirements could not be resolved to an installable set of packages. Problem I Some package is locked and an update was not requested Some package requires another package, but it conflicts with another require</code></pre> <p>Wait, what? Why?</p> <p>And it finished with...</p> <pre> <code class="language-bash">Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.</code></pre> <p>But why?! I used it, is it playing with me? Is this script bullying me?</p> <p>Well, no. I realized today, that using Composer within Lando can be confusing for the script sometimes.</p> <p>Somehow, the <code>--with-all-dependencies</code> flag was ignored.</p> <p>The fix is easy. We just need to make sure that the command gets separated, and everything after <code>composer</code> is treated as an argument for Composer, and not Lando.</p> <p>Just add a double dash. Like this:</p> <pre> <code class="language-bash">lando composer update -- drupal/core "drupal/core-*" --with-all-dependencies</code></pre> <p>This is a command line thing. Everything after the double dash <em>is an argument </em>for <code>composer update</code>, and that's it. It worked. It worked so smoothly I felt like I had seen the stars in the meme.</p> <img alt="Mind-blown meme" data-entity-type="file" data-entity-uuid="92bf5421-5e1b-4b1e-8d54-742a54ec9f64" src="/sites/default/files/inline-images/mind-blown-mind.gif" class="align-center" width="314" height="210" loading="lazy" /> <p>Hope this is useful to you as well.</p>

Related blog posts

Pantheon Discord Webhook Integration

Pantheon Quicksilver script to send notifications to Discord

Hand-picked content at the top of a chronologically sorted view: Option 2, Entity queues

Following the one way or another series we’ll solve the problem of overriding the default order of a view with hand picked contents through Entity queues.

Hand-picked content at the top of a chronologically sorted view: Option 1, make it Sticky!

This is the first of the One way or another series. A set of blog posts where we explore different ways to implement similar features. Our topic today is: Sticky content on top of lists!