Node_modules waste disk space

when run
ionic start project template
there alway directory node_modules that have same modules in all projects
how to make it modules global an not trash project folder?

My advice is: get a bigger disk. Once you have a few different projects going at the same time, they are all going to have different dependencies. And a library could introduce a breaking change at any time, so different projects won’t all be running the same version of a library.

5 Likes

That’s how JS development with npm works. Using workarounds will cause you pain with not very much benefits. Don’t do it.

1 Like

Do Ionic projects keep library version in config files so I don’t have to upload the whole node_modules folder to a git hub repository??

Look at package.json.

Make sure this doesn’t happen. Ionic projects by default have node_modules in .gitignore. Leave that alone.

1 Like

If you’re using npm 5.x, commit package.lock.json to git. (Should happen automatically, at least it does in bitbucket, which I use.) That is a lightweight representation of dependency files.

1 Like

Thanks @rapropos @AaronSterling I’ll follow your notes