A
A
Alex2015-07-18 00:42:01
ubuntu
Alex, 2015-07-18 00:42:01

How to remove unused npm packages?

I recently started learning Grunt.
And here's the crux of the matter:
Let's say I install package
npm install SomePack --save-dev
A, a bunch of other plugins are installed in place with it.
A little later I removed SomePack:
npm uninstall SomePack
Are all dependency plugins removed too? Or stay?
And how can I "clean" from unused plugins?
For example, I only use SomePack1and SomePack2. Accordingly, I only need them and their dependencies. How to remove everything else?
Maybe there is some command "Delete everything" or "Delete everything except ..."?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2015-07-18
@Kozack

See how the directories are organized all in node_modules
All SomePack1 dependencies are in its directory
Dependencies are not rummaged

T
Tinki-Vinki, 2016-09-25
@Tinki-Vinki

Remove unused packages from the cache
$ sudo apt-get autoclean
Cleaning the cache in Ubuntu, apt utilities:
$ sudo apt-get clean
Remove unnecessary dependencies:
$ sudo apt-get autoremove

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question