如何卸载纱线?我已经将它用于一个react-native项目,现在每当我将代码移出index.ios.js或index.android.js时,它都会抛出一个错误,所以我只想使用npm,但每当我初始化一个react-native项目时,它默认为yarn。我尝试了npm卸载yarn,但没有工作。谢谢。
当前回答
npm uninstall yarn删除了通过npm安装的yarn包,但是yarn在你的电脑中安装了一个名为yarn的软件。如果你已经安装在Windows上,去添加或删除程序,然后搜索yarn并卸载它,然后你就可以去了。
其他回答
我必须手动从驱动器中删除Yarn文件夹,然后再次运行npm uninstall -g Yarn重新安装它。这对我很管用。
没有看到对我有用的答案,所以它是:在我的OSX系统上,我在~/.yarn/bin/yarn找到了yarn。Rm -rf ~/。纱处理了它。
我尝试了sospedra发布的Homebrew和tarball points。这还不够。
我发现yarn安装在~/.config/yarn/global/node_modules/yarn
我跑纱线全球除去纱线。重新启动终端,它消失了。
最初,我来这里是因为yarn恢复到旧版本,但我不知道为什么,尝试卸载或升级失败。
当我检出某个项目的旧分支时,使用的yarn版本从1.9.4变成了0.19.1。
即使在采取步骤去除纱线后,它仍然保持在0.19.1。
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>\)
如果在你的系统上,Yarn是由Node.js通过corepack提供的,那么,你可以选择你想要使用的Yarn版本,如下所述:
Corepack准备yarn@x.y.z—激活
- https://nodejs.org/api/corpac.html #升级全球版本
推荐文章
- ReferenceError: description没有定义NodeJs
- 将一个二进制的NodeJS Buffer转换为JavaScript的ArrayBuffer
- AngularJS只适用于单页应用程序吗?
- 如何在vue-cli项目中更改端口号
- 同步和异步编程(在node.js中)的区别是什么?
- 如何编辑通过npm安装的节点模块?
- “node_modules”文件夹应该包含在git存储库中吗
- 使用package.json在全局和本地安装依赖项
- this.libOptions.parse不是一个函数
- 对嵌套文件夹运行npm install的最好方法是什么?
- 节点Multer异常字段
- 很好的初学者教程socket.io?
- CALL_AND_RETRY_LAST分配失败-进程内存不足
- 在Ubuntu上安装Node.js
- 使用express.js代理