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 →
- Commit
package-lock.jsonand usenpm ciin CI, which fails if the lockfile andpackage.jsondisagree. - Pin the Node version (
.nvmrcorengines). - Point
.npmrcat 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.
More on Builds, Artifacts, Nexus, SonarQube and Testing
A Maven project resolves dependencies from Maven Central on every build and a left-pad style outage would stop all builds.BeginnerYou must publish snapshot and release artifacts without overwriting a released version.IntermediateEvery merge to main should produce a unique semantic version automatically.IntermediateThe SonarQube quality gate must block merging PRs that add new bugs, vulnerabilities or uncovered code.IntermediateCoverage shows 0% in SonarQube although tests run in CI.IntermediateA big legacy codebase fails every Sonar gate. Teams ignore the tool. How do you adopt it?Intermediate