Sitemap
Tushar Kanjariya

Tushar Kanjariya

Full-Stack Developer sharing insights on code, design, and AI. 6+ Years of Experience in Tech.

Member-only story

I Used npm Wrong for Years

AI knows npm install. What about the rest?

10 min read10 hours ago

--

For years, I knew exactly three npm commands. npm install, npm run dev, and npm install again when something broke.

That third one is the giveaway.

Read Free for non-members.

When npm did something I didn’t understand, I didn’t have a command to find out why. I deleted node_modules and tried again.

Sometimes it worked. Sometimes it didn’t. But I rarely understood what had gone wrong.

AI coding agents mostly work the same way now. They run npm install, and when it errors, the common suggestion is --force or --legacy-peer-deps.

It usually makes the error go away. It rarely tells you what was wrong.

These are the npm commands I learned late, grouped by the problem each one solves.

If you only skim, take three: npm ci for builds, npm explain for “why is this installed?”, and overrides for fixing a dependency you don’t control.

Press enter or click to view image in full size
Essential npm Commands | Tushar Kanjariya
Essential npm Commands

npm ci: the install your builds should use

npm ci

I used to run npm install everywhere, including production builds.

--

--

Tushar Kanjariya
Tushar Kanjariya

Written by Tushar Kanjariya

Full-Stack Developer sharing insights on code, design, and AI. 6+ Years of Experience in Tech.