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 ?
This question is related to
react-native
npm uninstall --save package_name
or npm uninstall --save-dev package_name
npm unlink package_name
then follow step 1note rnpm as is deprecated
I followed the following steps:--
react-native unlink <lib name>
-- this command has done the unlinking of the library from both platforms.
react-native uninstall <lib name>
-- this has uninstalled the library from the node modules and its dependencies
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
you have to check your linked project, in the new version of RN, don't need to link if you linked it cause a problem, I Fixed the problem by unlinked manually the dependency that I linked and re-run.
If you want to unlink already installed packages in react native
$ react-native unlink package_name
$ yarn remove package_name
(if it is npm then npm uninstall --save)If you execute 2nd step before 1st step you need to install relevant package back and execute 2nd step
I will post my answer here since it's the first result in google's search
1) react-native unlink <Module Name>
2) npm unlink <Module Name>
3) npm uninstall --save <Module name
From react-native --help
uninstall [options] uninstall and unlink native dependencies
Ex:
react-native uninstall react-native-vector-icons
It will uninstall and unlink its dependencies.
Source: Stackoverflow.com