garson garson - 1 month ago 6x
Git Question

Cloning an app from github -- missing module depencines. How to install all at once?

I am cloning clementine.js from github at this URL:

However, when I try to run it by cd'ing into the folder with "server.js" and typing "node server.js" I get an error saying that the 'mongoose' module hasn't been installed. Looking at the package.json file, it looks like many of the modules in clementine.js are ones I haven't installed before. Is there a way to use command line node to just install anything in the package.json file that I haven't install yet?



Yes, you use npm install from the directory containing the package.json file. This is one of the great things about package managers: You just list the dependencies without having to have them actually checked into the project's repository (which is good, as there are sometimes thousands upon thousands of files involved).