All jobs / Frontend / web developer / Tooling
Frontend / web developer interview question · 0–1 years
CI installed different package versions than your laptop. Strongest fix?
The strongest answer
Commit the lockfile and install in CI with npm ci (or the equivalent) so the lock is the source of truth
Why it works
Reproducible installs are a lockfile plus a clean install command. That is the interview answer.
What a good answer covers
- Lock the graph, install from the lock.
- Commit package-lock / pnpm-lock / yarn.lock.
- CI: npm ci (or pnpm i --frozen-lockfile).
- Never commit node_modules.
Answers that fall short
- Close, but not the strongest: Delete node_modules locally and run npm install again
Reinstalling locally may hide that CI was using npm install without a committed lock. - Weak: Pin nothing and always take latest so everyone stays 'current'
Floating latest makes every install a different app. - Red flag: Commit node_modules into git
node_modules in git is huge, OS-specific, and still not how you ship.
Who gets asked this
More Tooling questions
- How do you use DevTools to find out where it fails?
- You need an API base URL in a Vite app without leaking a private key. What do you do?
- Fast Refresh resets a component's state on every edit. What usually caused it?
- A half-rolled feature is erroring in production. Strongest frontend move?
- What does a bundler such as Webpack or Vite’s production build actually do for you, and what breaks tree…
- Three product teams ship the same header with three bugs. How do you organize frontend platform work?
- A critical vulnerability is published in a package three levels down your dependency tree. The scanner is red…
- Shared packages in a monorepo keep causing diamond-dependency breaks. What do you enforce?