How To Uninstall Yarn?

535    Asked by Amitraj in SQL Server , Asked on Nov 17, 2022

I had installed Yarn for some demo. Now I am trying to run a react project using npm but by default, it always changes to Yarn. I don't need Yarn now, so I want to uninstall it. I tried the following command but it did not work: sudo apt-get remove yarn && sudo apt-get purge yarn

How can I uninstall Yarn?

Answered by Amit raj
To uninstall yarn -
Try this, it works well on macOS:
$ brew uninstall --force yarn
$ npm uninstall -g yarn
$ yarn -v
v0.24.5 (or your current version)
$ which yarn
/usr/local/bin/yarn
$ rm -rf /usr/local/bin/yarn
$ rm -rf /usr/local/bin/yarnpkg
$ which yarn
yarn not found
$ brew install yarn
$ brew link yarn
$ yarn -v
v1.17.3 (latest version)

Or you could install it as recommended on the website (https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable) through npm using:

  $ npm install --global yarn


Your Answer

Interviews

Parent Categories