How to uninstall npm modules in node.js?
In this small post, find out how to uninstall npm packages from a node.js project or globally. Any npm package can be installed easily using the npm install command. But most of the times we ignore the installed package and forget about them. How do we uninstall npm modules? Read on.
The syntax to uninstall npm packages is
npm uninstall <package-name>
npm uninstall mongoose
npm uninstall winston
To uninstall globally, just use -g flag.
npm -g uninstall winston
Uninstall multiple npm packages
To uninstall multiple npm packages, separate them by space.
npm uninstall mongoose winston