How to ignore node_modules using .gitignore?

I’m not sure how to ignore files on .gitignore, I think it has 3 options but I don’t know the correct one

  1. /node_modules
  2. .node_modules
  3. .node_modules/

Please, can you tell me which is the correct one or if none of the 3 works, can you tell me how to ignore files on .gitignore?

I really appreciate any help you can provide.

>Solution :

use node_modules or /node_modules both should work also try to look at the node.gitignore, it will give you an idea on what to ignore in your project

Leave a Reply