For example, I have following structure
main
-- doTask1
-- task1-1.js
-- task1-2.js
-- doTask2
-- task2-1.js
-- task2-2.js
If I run npm install <some package>
in doTask1
, a new directory node_modules
is created in doTask1
.
Now in doTask2
, I need to use the same package, do I need to run npm install <some package>
in doTask2
again? It will create another node_modules
in doTask2
which is duplicate. What's the correct way to manage this?