When automatically initiated ‘npm install’ does not create “package-lock.json” file, and when run from the console it does.
Do I want this “package-lock.json” file to be created, or should I run install command from the console with some arguments to mimic automatic installation procedure?
unfortunately, when you run
npm install from the console, it not only creates package-lock.json, but it also modifies package.json, breaking the editor. That’s why we don’t create the package-lock.json by default. I would encourage you to switch to pnpm, our preferred package manager, which has near 100% compatibility with npm and allows you to save a lot of space and time. From the console, run
enable-pnpm. It uses a file named shrinkwrap.yaml instead of package-lock.json.
Thanks. I switched to npm the other day since pnpm installation would sometimes delay site wakeup for more than 10 seconds (“resolving” something repeatedly). Wakeup event is a place where I would pay megabytes to buy seconds, not the other way around.
To be fair, that’s not ordinarily the case - it’s just because we were having some server issues that caused such a delay. Once cached, the wake up time should only be slightly longer with pnpm than npm.
I know about server issues, and I’m ready to hop back to pnpm if I see it offers even the slightest advantage.
However, judging on how the server problem manifested itself, it seems to me there is something non-deterministic about the process which worries me not knowing what is it, why is it, or anything at all about it actually. So pointers to further and detailed info on the process and different possible setup optiins are welcome.
We feel the same way The main problem is that node package management is a hard problem. There’s lot of information here: https://pnpm.js.org/
How can i make package lock.json file visible in my project