To uninstall a npm module, you can use the uninstall command of npm.
npm uninstall <module_name>
This will remove the module from the node_modules directory and delete the entry in the package.json file.
If you want to uninstall the module and save the changes in your package.json file, you can use the --save flag:
npm uninstall --save <module_name>
This will remove the module from the node_modules directory and update the dependencies field in the package.json file.
If you want to uninstall the module and save the changes in your package-lock.json file as well, you can use the --save-prod flag:
npm uninstall --save-prod <module_name>
This will remove the module from the node_modules directory and update the dependencies field in both the package.json and package-lock.json files.
Comments (0)