简体   繁体   中英

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...

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM