TheBoubou
TheBoubou

Reputation: 19903

With Git how ignore node_modules on commit

I'd like not commit the folder "node_modules"

I tried several solutions found around the web :

  1. Create a file .gitignore (placed in the route of my application at same level than .git folder)
  2. In this file I tried : node_modules and /node_modules/ and that /node_modules/** and that node_modules/**

When I do npm install this folder and all the packages are added to the file to commit and I get a warning from Visual Studio code because there are 5000 elements to commit.

Any idea ?

Upvotes: 0

Views: 1610

Answers (1)

Alan Aranda
Alan Aranda

Reputation: 242

Create a .gitignore file and add node_modules/ if node_modules/ was added to your repository then you need to delete or .gitignote doesn't work.

Upvotes: 1

Related Questions