Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

How To Uninstall Yarn?

Asked by Amit Raj Nov 17, 2022 7.6K views 2 answers
Share

About this question

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?

Your answer

2 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on Feb 5, 2025

Uninstalling Yarn depends on how you installed it. Below are different methods based on your installation type.

Uninstalling Yarn Based on Installation Method

1. If Installed via npm

If you installed Yarn using npm, you can remove it with:

  npm uninstall -g yarn

  • This removes Yarn globally from your system.

To confirm it’s uninstalled, run:

  yarn --version

If the command is not found, it’s successfully removed.

2. If Installed via Homebrew (macOS/Linux)

For macOS and Linux users who installed Yarn via Homebrew, use:

  brew uninstall yarn

If you want to remove all dependencies, run:

  brew cleanup

3. If Installed via Chocolatey (Windows)

For Windows users who installed Yarn using Chocolatey, remove it with:

  choco uninstall yarn

4. If Installed via the Yarn Installer

If you installed Yarn via the standalone installer:

  • Manually delete Yarn from your system’s installation directory (usually in C:Program Files (x86)Yarn on Windows or /usr/local/bin/yarn on Linux/macOS).

Final Checks

After uninstallation, verify it's removed by running:

  yarn --version

If you get an error like "command not found," Yarn is successfully uninstalled.


Was this helpful?

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.