Is there a command to remove all global npm modules? If not, what do you suggest?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- Failed at the electron@1.8.2 postinstall script
- How to reimport module with ES6 import
- Webpack getting started, import error
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
If you would like to remove all the packages that you have installed, you can use the
npm -g ls
command to find them, and thennpm -g rm
to remove them.if you have Intellij Webstorm you can use its built-in graphical package manager.
open it as root and create an emtpy project. go to
there you will see all the installed packages. Uninstalling is easy, you can select and deselect any package you want to uninstall, Ctrl+a woks as well.
worked for me
sudo npm list -g --depth=0.
lists all top level installedawk -F ' ' '{print $2}'
gets rid of ├──awk -F '@' '{print $1}'
gets the part before '@'sudo xargs npm remove -g
removes the package globallyJust put in your console:
sudo npm list -g --depth=0. | awk -F ' ' '{print $2}' | awk -F '@' '{print $1}' | sudo xargs npm remove -g
Its work for me...
It's as simple as:
rm -rf ~/.npm
The following command removes all global npm modules. Note: this does not work on Windows. For a working Windows version, see Ollie Bennett's Answer.
Here is how it works:
npm ls -gp --depth=0
lists all global top level modules (see the cli documentation for ls)awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}'
prints all modules that are not actually npm itself (does not end with/npm
)xargs npm -g rm
removes all modules globally that come over the previous pipe