Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to delete installed library form react native project

Tags:

react-native

I have installed a third party library in my project but it is not working , so I want to delete that library from my project , How can I do that ?

like image 793
rajat44 Avatar asked Jul 27 '16 13:07

rajat44


People also ask

How do I delete a react-native project?

When you create a new React project, all the project files are stored inside a project directory. To delete React app, just simply delete this directory. If you get any errors during this process, try to use the terminal instead of file explorer.


2 Answers

  1. If it is a library based only on javascript, than you can just run npm uninstall --save package_name or npm uninstall --save-dev package_name
  2. If you've installed a library with native content that requires linking, and you've linked it with rnpm then you can do: rnpm unlink package_name then follow step 1
  3. If you've installed a library with native content manually, then just undo all the steps you took to add the library in the first place. Then follow step 1.

note rnpm as is deprecated

like image 99
Aakash Sigdel Avatar answered Sep 20 '22 12:09

Aakash Sigdel


I followed the following steps:--

  1. react-native unlink <lib name> -- this command has done the unlinking of the library from both platforms.

  2. react-native uninstall <lib name> -- this has uninstalled the library from the node modules and its dependencies

  3. Manually removed the library name from package.json -- somehow the --save command was not working for me to remove the library declaration from package.json.

After this I have manually deleted the empty react-native library from the node_modules folder

like image 40
Nicks Avatar answered Sep 21 '22 12:09

Nicks