Re:Cleaning house in Nx monorepo, how i removed unused deps ...
by rectang on Sunday September 28, 2025 @11:47PM
(#45410162)
Does anybody disable `npm install`? For yourself? For a team?
Re:Cleaning house in Nx monorepo, how i removed unused deps ...
by zdragnar on Monday September 29, 2025 @12:43AM
(#45410396)
The official tutorial at https://nodejs.org/en/learn/getting-started/an-introduction-... says to use `npm install` and makes no mention of `npm ci` at all. Further, the name of the command (though not the clean-install alias) shows that it was tacked on top of a fundamentally broken base.
> That's basically a crap shoot because even if you specifically pin the versions of all your dependencies, chances are that at least some of your dependencies did not have the good sense to do the same for their dependencies.
As I mentioned in my first comment, I don't really want my dependencies to pin their dependencies. I want them to specify a range they work with to minimize the number of redundant copies of common transitive dependencies.
Yes, that's `npm ci`.
With a fresh `npm install` you get the latest packages that satisfy dependencies in the ranges spec'd in package.json. That's basically a crap shoot because even if you specifically pin the versions of all your dependencies, chances are that at least some of your dependencies did not have the good sense to do the same for their dependencies. This is the path to hell.
With a fresh `npm ci` on the other hand, you get back exactly to the known state specified in package-lock.json, where everything is pinned, all the way down. This is the path to happiness.