Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use one node_module folder for all angular2/4 projects

I am learning Angular and each time it takes like 5 minutes to create a new project because of 100MB folder "node_modules" which CLI creates. And the files in this folder are always the same (unless you add some dependencies which I never do). Is there a way to use one node_modules folder for every project?

like image 372
displayName Avatar asked Aug 14 '26 05:08

displayName


1 Answers

Have a look in to https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/

Yarn Workspaces is a feature that allows users to install dependencies from multiple package.json files in subfolders of a single root package.json file, all in one go.

Making Workspaces native to Yarn enables faster, lighter installation by preventing package duplication across Workspaces. Yarn can also create symlinks between Workspaces that depend on each other, and will ensure the consistency and correctness of all directories.

npm install -g yarn

like image 183
angularrocks.com Avatar answered Aug 16 '26 18:08

angularrocks.com