Interview Prep/CI/CD/Builds, Artifacts, Nexus, SonarQube and Testing

An npm build is non-reproducible: different versions install on different days.

BeginnerScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer

Situation read → Missing or ignored lockfile.

What I'd do →

  1. Commit package-lock.json and use npm ci in CI, which fails if the lockfile and package.json disagree.
  2. Pin the Node version (.nvmrc or engines).
  3. Point .npmrc at the Nexus npm proxy.

Why → npm ci installs exactly what is locked and wipes node_modules first.

Interview tip → npm install may rewrite the lockfile; npm ci never does.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Builds, Artifacts, Nexus, SonarQube and Testing