How Do I Uninstall Yarn

前端 未结 19 1161
醉话见心
醉话见心 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:08

    remove yarn

    # macOS & brew
    $ brew uninstall yarn
    
    
    

    remove npm package

    yarn global remove

    # yarn global remove
    $ sudo yarn global remove @tarojs/cli
    
    
    # yarn global add 
    $ sudo yarn global add @tarojs/cli
    
    
    

    refs

    https://classic.yarnpkg.com/en/docs/cli/global/

    https://classic.yarnpkg.com/en/docs/cli/remove/

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

    For Windows User:

    Just use the installer file(i.e yarn-1.22.4.msi in my case) to uninstall yarn.

    Once you open the installer you will get three options, i.e to install, repair and uninstall yarn from your machine. Select uninstall and it will remove all the yarn files from your pc.

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

    On my Mac neither of these regular methods to uninstall Yarn worked:

    brew: brew uninstall yarn

    npm: npm uninstall -g yarn

    Instead I removed it manually by typing rm -rf ~/.yarn (thanks user elthrasher) and deleting the two symbol links yarn and yarnpkg from usr/local/bin. Afterwards brew install yarn gave me the latest version of Yarn.


    Background: The fact that I had a very outdated version of Yarn installed gave me utterly incomprehensible errors while trying to install additional modules to a project set up with Vue CLI Service and Vue UI, which apparently uses Yarn 'under the hood'. I generally use NPM so it took me a while to figure out the cause for my trouble. Naturally googling error messages produced by such module incompatibilities presented no clues. With Yarn updated everything works just perfectly now.

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

    Didn't see the answer that worked for me, so here it is: On my OSX system I found yarn at ~/.yarn/bin/yarn. rm -rf ~/.yarn took care of it.

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

    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)

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

    I tried the Homebrew and tarball points from the post by sospedra. It wasn't enough.

    I found yarn installed in: ~/.config/yarn/global/node_modules/yarn

    I ran yarn global remove yarn. Restarted terminal and it was gone.

    Originally, what brought me here was yarn reverting to an older version, but I didn't know why, and attempts to uninstall or upgrade failed.

    When I would checkout an older branch of a certain project the version of yarn being used would change from 1.9.4 to 0.19.1.

    Even after taking steps to remove yarn, it remained, and at 0.19.1.

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