How can I uninstall yarn? I\'ve used it for a react-native project and now whenever I move the code out of index.ios.js
or index.android.js
it thro
npm uninstall yarn removes the yarn packages that are installed via npm but what yarn does underneath the hood is, it installs a software named yarn in your PC. If you have installed in Windows, Go to add or remove programs and then search for yarn and uninstall it then you are good to go.
In case you installed yarn globally like this
$ sudo npm install -g yarn
Just run this in terminal
$ sudo npm uninstall -g yarn
Tested now on my local machine running Ubuntu. Works perfect!
I couldn't uninstall yarn on windows and I tried every single answer here, but every time I ran yarn -v
, the command worked. But then I realized that there is another thing that can affect this.
If you on windows (not sure if this also happens in mac) and using nvm, one problem that can happen is that you have installed nvm without uninstalling npm, and the working yarn
command is from your old yarn version from the old npm.
So what you need to do is follow this step from the nvm docs
You should also delete the existing npm install location (e.g. "C:\Users<user>\AppData\Roaming\npm"), so that the nvm install location will be correctly used instead. Backup the global npmrc config (e.g. C:\Users<user>\AppData\Roaming\npm\etc\npmrc), if you have some important settings there, or copy the settings to the user config C:\Users<user>.npmrc.
And to confirm that you problem is with the old npm
, you will probably see the yarn.cmd
file inside the C:\Users\<user>\AppData\Roaming\npm
folder.
What I've done on my side:
Went to the /usr/local/lib/node_modules
, and deleted the yarn
folder inside it.
I had to manually remove(delete) the Yarn
folder from drive and then run npm uninstall -g yarn
again to reinstall it. It worked for me.
If you are still getting errors after deleting ~/.yarn about files not being found, don't forget to delete the yarn rc file:
rm ~/.yarnrc.yml