If you don't need to use a package in your project, you can uninstall it and remove it from your project’s dependencies.
For Uninstalling any local package use following command:
npm uninstall <package_name>
For Uninstalling any global package use following command:
npm uninstall -g <package_name>
To confirm that npm uninstall has been worked successfully, check the node_modules directory no longer contains a directory for the uninstalled packages.