StoicBuilder

HandbookII the ForumPackages and dependencies

IIthe Forum, The shape of an app

Packages and dependencies

1 min readUpdated 28 November

In plain words

A package is ready-made code from someone else, installed with npm, and your dependencies are the full list of packages your app needs to run.

Where you see it

The dependencies list in package.json, the enormous node_modules folder you never open, and lines like npm install date-fns scrolling past in your agent's terminal. A fresh Lovable project already has dozens.

Terminalterminal
$ npm install date-fns added 1 package, and audited 312 packages in 2s found 0 vulnerabilities
The install adds a line to package.json and pins the exact version in package-lock.json.

What goes wrong

  1. Installing a package that shouldn't exist

    Agents sometimes invent plausible package names, and attackers publish malware under exactly those names. Check the package on npmjs.com before it goes in.

  2. A new package for a one-line job

    Every package is code you now trust and have to keep updated. Check whether something already in package.json does the job.

  3. Deleting package-lock.json to fix an error

    The lock file pins exact versions. Delete it and the next install can pull newer versions that behave differently on your host.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Before installing any new package, tell me its exact name, what it does, how widely it's used and whether something already in package.json could do the job. Don't delete or regenerate package-lock.json unless I ask.

Quick check

Sign in to earn +10 XP for it

Your agent wants to run npm install react-auth-helpers-pro to fix a login bug. What do you do first?

Got a prompt that touches packages and dependencies?

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

Check your own prompt

Free, no sign-up.