# IT:AD:npm:HowTo:Uninstall A Package # * [[./|(UP)]] * See also: * [[IT:AD:npm:HowTo:Deal With Long Filenames]] Uninstalling a package is about as easy installing. ## Process ## npm uninstall http-server or npm uninstall http-server -g ### Delete All Local Packages 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 Note that `npm uninstall` *can* handle paths that are longer than 260 -- whereas the standard [[IT/AD/CLI/|CLI]] cannot: * [[it/ad/npm/howto/deal_with_long_filenames]] ### Save the Changes to the package.json File `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 ## Resources ## * http://stackoverflow.com/questions/19106284/how-do-you-uninstall-all-dependencies-listed-in-package-json-npm