To uninstall an npm module in Node.js, you can use the uninstall
command of the npm CLI (Command Line Interface).
The uninstall
command takes the name of the module that you want to uninstall as an argument. For example:
npm uninstall express
This will uninstall the express
module from your Node.js project.
You can also use the -S
or --save
flag to remove the module from the dependencies
section of the package.json
file. For example:
npm uninstall express -S
This will uninstall the express
module and remove it from the dependencies
section of the package.json
file.
You can use the -D
or --save-dev
flag to remove the module from the devDependencies
section of the package.json
file.
npm uninstall express -D