How to uninstall a library from a node project? 1


To uninstall a package you have previously installed locally (using npm install <package-name> in the node_modules folder, run following in your project terminal:

 

 

npm uninstall <package-name>

 

 

This command will remove the library from node_modules folder and it will also remove the reference in the package.json file.

 

If the package is installed globally, you need to add the -g / --global flag:

 

 

npm uninstall -g <package-name>

 

 

for example:

 

 

npm uninstall -g bcrypt

 

 

and you can run this command from anywhere you want on your system because the folder where you currently are does not matter.