Uninstalling a package is about as easy installing.
If you want to uninstall all packages, use IT:AD:Powershell, place yourself in the local root directory and do the following:
npm uninstall (Get-ChildItem .\node_modules).Name
npm uninstall can handle paths that are longer than 260 – whereas the standard CLI cannot:
* IT:AD:npm:HowTo:Deal With Long Filenames
npm uninstall just removes the package, but leaves the reference to the package in the package.json file.
If you want all mention of the package removed, use the -S or -D flags:
# remove from the dependencies section of package.json: npm uninstall foobar -S # or from the devDependencies section of package.json: npm uninstall foobar -D
It's wise to also clear the cache:
npm cache clear