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
For those using Windows, the easiest way to remove all globally installed npm packages is to delete the contents of:
C:\Users\username\AppData\Roaming\npm
You can get here quickly by typing
%appdata%
(either in explorer, run prompt, or start menu).For those using Powershell:
To clear the cache:
If you have jq installed, you can go even without grep/awk/sed:
On Debian and derived you can install jq with:
sed solution
Well if you are on windows, and want to remove/uninstall all node_modules then you need to do following steps.
Type below command and give it for 1-2 minutes it will uninstall all directories inside node_module
Hope this will help some one on windows
OS not specified by OP. For Windows, this script can be used to nuke the local and the user's global modules and cache.
I noticed on linux that the global root is truly global to the system instead of the given user. So deleting the global root might not be a good idea for a shared system. That aside, I can port the script to bash if interested.
For Windows, save to a cmd file to run.