Node.js npm Uninstalling packages

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

To uninstall one or more locally installed packages, use:

npm uninstall <package name>

The uninstall command for npm has five aliases that can also be used:

npm remove <package name>
npm rm <package name>
npm r <package name>

npm unlink <package name>
npm un <package name>

If you would like to remove the package from the package.json file as part of the uninstallation, use the --save flag (shorthand: -S):

npm uninstall --save <package name>
npm uninstall -S <package name>

For a development dependency, use the --save-dev flag (shorthand: -D):

npm uninstall --save-dev <package name>
npm uninstall -D <package name>

For an optional dependency, use the --save-optional flag (shorthand: -O):

npm uninstall --save-optional <package name>
npm uninstall -O <package name>

For packages that are installed globally use the --global flag (shorthand: -g):

npm uninstall -g <package name>


Got any Node.js Question?