Interview Prep/CI/CD/GitHub Actions Failures

`Error: Cannot find module` or tests pass locally but fail on `ubuntu-latest` only after a runner image update.

AdvancedTroubleshootingGitHub Actions Failures
Answer

Likely causes → ubuntu-latest moved to a new image with different tool versions; unpinned tool versions.

Diagnose → Compare "Runner Image" version in the Set up job section between a green and red run.

Fix → Pin the OS (ubuntu-24.04) and tool versions; fix the code for the new defaults.

Prevent → Pin runner images and upgrade deliberately with a canary workflow.

All CI/CD questions

More on GitHub Actions Failures