Answer the question
In order to leave comments, you need to log in
Can npm use the same module for different projects?
I type npm install all the time for the same modules. Some kind of react react-dom axios etc.
Can npm store them centrally on the local machine?
What is in node_modules? Another clone of the same files or some kind of symlinks?
If a clone - is there a symlink mode or any other mechanism not to unload the same versions of the same packages tens and hundreds of times?
Answer the question
In order to leave comments, you need to log in
Found the answer.
npm is not optimized by default in the sense that the question was asked about.
yarn - caches packages, but still copies them every time spawning pnpm copies
- solves the problem. And caches and thanks to hardlinks does not produce clones. ( https://pnpm.js.org)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question