Answer the question
In order to leave comments, you need to log in
How can I set up package.json so that no global modules are installed in the application's local node_modules folder?
How can I configure package.json so that modules that are already globally installed in the system are not installed in the application's local node_modules folder?
Can you do it in stages? For example, 1) get a list of modules that are installed globally, 2) check the list in package.json, 3) install those that match as npm link, 4) then install the rest with the npm i command
In this scheme, I understand everything how to do it, except first paragraph. How to get a list of globally installed modules from a script?
PS Why do I need it?
I want to do this only to speed up the deployment of my application. For now, with each deploy command, node_modules is reinstalled. And this is a slow process. Without it, the deployment would be much faster.
Answer the question
In order to leave comments, you need to log in
Everything, the question is closed. I found a command that makes links to globally installed modules. And those modules that are not installed are installed locally.
Or, ideally, of course, it is better to put such a command:npm i --link --production
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question