0

Node JS newbie here, I am testing the imgur node module from here. I run

npm install imgur --save

and when I look in the relevant node_modules folder I see about 50 or 60 modules listed. Why so many!? Are all these required?

Also, If I start multiple projects (different folders on my machine), do I have to have all those modules in each of the relevant node_modules folders, or is there a way to have ONE node_modules folder that would serve all of my test projects (imgur in this case)?

Thanking you.

Lord Null
  • 856
  • 1
  • 9
  • 20
  • This is all of the dependencies of imgur. Imgur itself also gets dependencies. They are required – yue you Feb 05 '18 at 18:29

1 Answers1

0

Q: Why so many!?

A: Because they are dependencies of imgur. Based on the doc here https://www.npmjs.com/package/imgur, it has 27 depedencies. Each of them will be in a seperated folder under node_modules

Q: Are all these required?

A: Yes. They are dependencies for imgur to get running as expected

Q: If I start multiple projects (different folders on my machine), do I have to have all those modules in each of the relevant node_modules folders, or is there a way to have ONE node_modules folder that would serve all of my test projects (imgur in this case)?

A: Yes. Keeping node_modules separately for different project is a good practice. If you want to use only one source to find libraries. Use npm install -g command and set the NODE_PATH environment variable to the path, the modules can be found by your project. Check detail here: Where does npm install packages?

Hope it helps

yue you
  • 2,206
  • 1
  • 12
  • 29