How Do I Uninstall Yarn

前端 未结 19 1162
醉话见心
醉话见心 2020-12-22 17:45

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

相关标签:
19条回答
  • 2020-12-22 18:14

    If you installed with brew, try brew uninstall yarn at terminal prompt. Also remember to remove yarn path info in your .bash_profile.

    0 讨论(0)
  • 2020-12-22 18:17

    Incase of windows, after executing npm uninstall -g yarn, still if yarn did not uninstalled, then go to "C:\Users\username\AppData\Local" and remove the yarn folder. Close the cmd and reopen the cmd and execute yarn . it will give you message 'yarn' is not recognized as an internal or external command, operable program or batch file.

    0 讨论(0)
  • 2020-12-22 18:20

    ng set --global packageManager=npm OR ng set --global packageManager=yarn

    0 讨论(0)
  • 2020-12-22 18:22

    on windows: Go to "Add or remove programs" in control panel (or open the start menu and search for "remove program")

    https://github.com/yarnpkg/yarn/issues/3331

    0 讨论(0)
  • 2020-12-22 18:22

    I'm using macOS. I had a few versions of yarn installed with Homebrew, which I uninstalled with brew uninstall --force yarn. I then installed the latest version 1.7.0 of Yarn using Homebrew brew install yarn

    But still when I ran which yarn, it returned /Users/Me/.yarn/bin/yarn, and yarn --version returned 0.24.6. There was no mention of Yarn in ~/.bash_profile, but my ~/.bashrc file contained the line export PATH="$HOME/.yarn/bin:$PATH" indicating that I must have previously installed Yarn globally, but I only wanted to use the latest version that I just installed with Homebrew.

    So I uninstalled Yarn globally by running npm uninstall -g yarn; rm -rf ~/.yarn, then editing the file ~/.bashrc by changing the line to export PATH="/usr/local/bin/yarn:$PATH" and running source ~/.bashrc to update the PATH in the terminal session. Then when I ran which yarn it returned /usr/local/bin/yarn, and when I ran yarn --version it returned 1.7.0

    0 讨论(0)
  • 2020-12-22 18:24

    Depends on how you installed it:

    brew: brew uninstall yarn

    tarball: rm -rf "$HOME/.yarn"

    npm: npm uninstall -g yarn

    ubuntu: sudo apt-get remove yarn && sudo apt-get purge yarn

    centos: yum remove yarn

    windows: choco uninstall yarn

    0 讨论(0)
提交回复
热议问题