Jump to the navigation menu

Don't use global dependencies

I recently watched a YouTube video of someone working on their software.

Everything was working locally, but things were breaking in their CI pipeline.

The issue was their CI environment had different versions of the software than the one they were using locally.

To get the same results locally and in CI, you need your dependencies to be the same.

The same versions of languages, such as PHP and nodejs, and packages like PHPStan, PHPUnit, Jest or eslint.

Dependencies should be installed with a package manager that generates a lock file like composer.lock or package-lock.json, so use these versions instead of installing versions globally that may be different.

For PHP or nodejs, I'd suggest using Docker or Nix, which has its own lock file, to make your environment as reproducible and consistent as possible.

- Oliver

Was this interesting?

Sign up here and get more like this delivered straight to your inbox every day.

About me

Picture of Oliver

I'm an Acquia-certified Drupal Triple Expert with 18 years of experience, an open-source software maintainer and Drupal core contributor, public speaker, live streamer, and host of the Beyond Blocks podcast.