Morton
Morton

Reputation: 5782

npm install -g not working while uninstalling react-native-cli?

I am trying to uninstall the "react-native-cli" which I use for react-native projects! but I am not able to do so! My environment is mac.

Here is what i have done so far!

Whether I type npm uninstall -g react-native-cli or sudo npm uninstall -g react-native-cli.

The terminal shows: up to date in 0.041s

enter image description here

When I type react-native init projectName, it still creates the project.

I think the command react-native init should not to work.

Anyone knows how to uninstall react-native-cli ?

Thanks in advance.

Upvotes: 6

Views: 27710

Answers (3)

VinukondaPraveen
VinukondaPraveen

Reputation: 211

You can uninstall react native CLI using:

npm uninstall -g react-native-cli

Upvotes: 2

Tuan Luong
Tuan Luong

Reputation: 4162

If you are using yarn. You can do yarn global list then check that if any package contains react-native. Then run yarn global remove <package> to remove that package.

ex:

yarn global remove @react-native-community/cli

Upvotes: 2

Rizwan Atta
Rizwan Atta

Reputation: 3295

SOLUTION ONE ! not fully sure this will work! but try updating your npm first by doing

npm install npm

and after that try uninstalling the cli if that does not work then

SOLUTION TWO !

Here is another go around to solve the issue its a bit manual way

1: First run this

npm list -g

this will show the list of installed packages in your user folder

then check . using command+f if there is react-native-cil there

then do this

open /usr/local/lib/node_modules

This will open the root installed packages and you can manually find and delete the react-native-cli like this

enter image description here

Upvotes: 14

Related Questions