如何卸载纱线?我已经将它用于一个react-native项目,现在每当我将代码移出index.ios.js或index.android.js时,它都会抛出一个错误,所以我只想使用npm,但每当我初始化一个react-native项目时,它默认为yarn。我尝试了npm卸载yarn,但没有工作。谢谢。


当前回答

Windows用户:

只需使用安装文件(i。e yarn-1.22.4。Msi在我的情况下)卸载纱线。

一旦你打开安装程序,你会得到三个选项,即安装,维修和卸载纱线从你的机器。 选择卸载,它将从你的电脑中删除所有的yarn文件。

其他回答

npm uninstall yarn删除了通过npm安装的yarn包,但是yarn在你的电脑中安装了一个名为yarn的软件。如果你已经安装在Windows上,去添加或删除程序,然后搜索yarn并卸载它,然后你就可以去了。

取决于你如何安装它:

酿造:酿造卸载纱线

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

Npm: Npm卸载-g yarn

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

拆纱:拆纱

Windows: choco卸载yarn(或去控制面板>添加/删除程序,并从那里卸载它)

Windows:

我需要做这些步骤,以完全去除纱线从系统。

Go to add or remove programs and then search for yarn and uninstall it(if you installed it with the .msi) npm uninstall -g yarn (if you installed with npm) Remove any existing yarn folders from your Program Files (x86) (Program Files (x86)\Yarn). Also need to delete your Appdata\local\yarn folder ( type %LOCALAPPDATA% in the run dialog box (win+R), it opens a local folder and there you'll find the yarn folder to delete) Finally,check your user directory and remove all .yarn folder, .yarn.lock file, .yarnrc etc ( from C:\Users\<user>\)

windows:在控制面板中选择“添加或删除程序”(或打开开始菜单,搜索“删除程序”)

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

如果在删除~/后仍然得到错误。Yarn文件找不到,不要忘记删除Yarn rc文件:

rm ~/.yarnrc.yml