StoicBuilder

HandbookIII the CastraDependency updates

IIIthe Castra, Stay in control

Dependency updates

1 min readUpdated 28 November

In plain words

Your app runs on hundreds of other people's packages, and updating them brings security fixes but can also change how things behave, so it needs care.

Where you see it

GitHub's Dependabot opens a pull request titled "Bump next from 16.0.6 to 16.0.7", or npm install ends with "3 high severity vulnerabilities". Both mean something in package.json needs a look.

Terminalterminal
npm outdatednpm auditnpm updatenpm run build && npm test
List what's behind, check for known holes, update within safe ranges, then prove it still builds.

What goes wrong

  1. Running npm audit fix --force

    It jumps packages across major versions to silence warnings and can quietly break your app. Read what it plans to change first.

    npm audit fix --force
  2. Updating everything at once

    Twelve packages move, the app breaks, and nobody knows which one did it. Update one or two, test, commit, repeat.

  3. Installing a package the agent made up

    Agents sometimes suggest package names that don't exist, and attackers register those names with malware inside. Look the package up on npmjs.com before installing.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Run npm outdated and npm audit, then update packages in small groups, starting with security fixes and patch versions. After each group, run the build and tests and commit, and ask me before any major version jump or npm audit fix --force.

Quick check

Sign in to earn +10 XP for it

npm audit reports five vulnerabilities, and the agent suggests npm audit fix --force. What's the risk?

Got a prompt that touches dependency updates?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.