Interview Prep/Docker/Build failures and cache problems

`npm ERR! code ELIFECYCLE` building native modules on Alpine (`gyp ERR! find Python`).

IntermediateTroubleshootingBuild failures and cache problems
Answer

Likely causes → Alpine lacks python3, make, g++ needed by node-gyp.

Diagnose → Read the full npm log with --progress=plain.

Fix → apk add --no-cache python3 make g++ in the build stage only, or switch to node:22-slim.

Prevent → Do native compiles in a builder stage, copy artifacts.

All Docker questions Roadmap: Docker & containers

More on Build failures and cache problems