3 ms·
> it can take actual minutes to find out where to place a dependency in a simple tree with npm. God, why ? npm is famous for a lot of things & reasons, but non
by capableweb 4y ago
> it can take actual minutes to find out where to place a dependency in a simple tree with npm. God, why ?
npm is famous for a lot of things & reasons, but none of those are "because it's well engineered".
To this day, npm still runs the `preinstall` script after dependencies have actually been downloaded to your disk. It modifies a `yarn.lock` file if you have it on disk when running `npm install`. Lots of things like these, so that the install is slow, is hardly surprising.
- hoten 4y agoSince when would npm install modify a yarn lock file?
- rickstanley 4y agoI don't know exactly the "since when", but recently I was caught off guard when issuing `npm i` by mistake in a yarn project. It modifies "yarn.lock" by changing some, if not all, the registry from yarn pkg registry to npm package registry.
- deleted 4y ago[deleted]
- seniorsassycat 4y agoNpm 7+ can read and write yarn.lock https://github.com/npm/cli/blob/latest/workspaces/arborist/lib/shrinkwrap.js#L1148 https://github.com/npm/cli/blob/latest/workspaces/arborist/l...