installed npm package exist on project on ec2?

i have a nodejs project. installed : npm install log4js, mongoose

project is on git , clonee on amazon EC2. do i have to run the npm commands also on ec2 machine ? or i can just run ?

You use git clone to get a local copy of a Git repository so you can look at it or start modifying it. So to use the project locally you will need node to be installed locally.

If you included node_modules directory in your project it should have the modules log4js, mongoose and you will not have to install them again.

You can use package.json to reference things like mongoose and log4js and really whatever you want. Then on the server you can simply run "npm install" and it'll grab everything fresh on the ec2 instance.

You might be thinking, "Why not just added the node_modules folder?" Well, it turns out that the node_modules folder can get awkwardly large with small files that really don't need to be there since it can be easily grabbed through npm anyways, so that's why we have package.json to reference project dependencies.

Here's a cool interactive guide to using package.json: http://package.json.nodejitsu.com/