Andreas
Andreas

Reputation: 85

Restore a angular project after git checkout

I'm new to Angular development. So I have a question concerning the data that will be stored in the git repository which was created by Angular CLI: Actually I created a new Angular workspace with ng new helloworld. The used Angular CLI version is 7.2.1. It will be created a Git repository. In the .gitignore file there are a bunch of entries. So far. With the ng new command, it creates some other important stuff like the node_modules folder.

Now the question is: If I checkout this git repository I will missing the node_modules folder. How is the way in this matter? How can I automatically create add the necessary node modules? I guess the storage of this node_modules folder is not the correct way because otherwise it would not be an entry of the .gitignore file...

Upvotes: 3

Views: 3987

Answers (1)

MonkeyScript
MonkeyScript

Reputation: 5121

The contents of node_modules is not meant to be committed to git. It just contains packages for the project as configured in the packages.json file. Once you checkout, go to the project directory and run

npm install

This downloads all required files from the cloud and populates a new node_modules directory.

Upvotes: 4

Related Questions