Why node_modules is ignored
You never commit node_modules to version control. It can contain thousands of files.
Instead, package.json records the versions you need, and anyone cloning your project runs npm install to recreate the folder. A file called .gitignore tells git to skip node_modules:
node_modules/
This keeps your repository small and lets your app be rebuilt anywhere.