Why we don't need to upload Node Modules in Github

Why we don't need to upload Node Modules in Github

Why do we need NPM

Npm is an open source collection of Modules. We use npm for 3 things :

1.Reuse our own code in other projects.

2.Use others code in our project.

3.Share our solutions in other developers projects.

Package Json

Package json is a JSON file which contains the dependencies of our projects.

When we clone some repository from github we don't need to install Node modules with it. Rather repo have a Package JSON file. And when we command NPM install node installs all npm modules that are required for the project.

So we don't need to upload Node Modules when we upload our code in GitHub. It makes our work easier by creating JSON file and when we clone it we can get the required dependancies.

Summary

So we learnt that we don't have to upload node modules in github and Package Json file contains the dependency required for our project.