Clean up dependencies and libraries not in use

Hi all, I spent some time trying to find out how to deploy my first app and while I was trying to build it constantly failed, the good news is that I found out what was the problem that is a deprecated library in the node_modules was problematic, and it wasn’t even used I added it experimenting to implement some sound engines on the browser but for some reason I abandoned that one and used another, so it was literally just sitting there and causing a huge problem, now coming out from this I am wondering if there is any tool that checks what libs and additional modules are used actively by the app so I know which ones might only be trash.

Any tips appreciated.

Best,
K.

Hi there! The answer here depends on what you are actually looking for. It sounds like you are mainly concerned with the node_modules folder, which is all just npm. So any npm way of finding used/unused packages could be used.

For instance, meteor npm prune (preface npm with meteor to use the meteor-installed npm) will find and remove any installed npm package that is not listed in your package.json. If instead, you want to find and remove unused packages that are in your package.json, something like npm-check could work.

If you are also concerned with finding/removing meteor packages that are not used, then there have been a couple of threads opened here, such as this one:

Hope this helps!

1 Like