From 4de852b3be24d1ec2bef981aa80edccb01f977cf Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 12 Feb 2025 23:49:05 +0000 Subject: [PATCH] Add daily email for 2025-02-01 Don't use global dependencies --- source/_daily_emails/2025-02-01.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 source/_daily_emails/2025-02-01.md diff --git a/source/_daily_emails/2025-02-01.md b/source/_daily_emails/2025-02-01.md new file mode 100644 index 00000000..b070d9bb --- /dev/null +++ b/source/_daily_emails/2025-02-01.md @@ -0,0 +1,26 @@ +--- +title: Don't use global dependencies +date: 2025-02-01 +permalink: daily/2025/02/01/global-dependencies +tags: + - software-development +cta: ~ +snippet: | + Don't use global system-wide versions of your dependencies, use the ones that are defined in your project. +--- + +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][0], to make your environment as reproducible and consistent as possible. + +[0]: {{site.url}}/daily/2025/01/20/reproducible