如何卸载纱线?我已经将它用于一个react-native项目,现在每当我将代码移出index.ios.js或index.android.js时,它都会抛出一个错误,所以我只想使用npm,但每当我初始化一个react-native项目时,它默认为yarn。我尝试了npm卸载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>\)
其他回答
取决于你如何安装它:
酿造:酿造卸载纱线
tarball: rm -rf "$HOME/.yarn"
Npm: Npm卸载-g yarn
Ubuntu: sudo apt-get remove yarn && sudo apt-get purge yarn
拆纱:拆纱
Windows: choco卸载yarn(或去控制面板>添加/删除程序,并从那里卸载它)
Windows用户:
只需使用安装文件(i。e yarn-1.22.4。Msi在我的情况下)卸载纱线。
一旦你打开安装程序,你会得到三个选项,即安装,维修和卸载纱线从你的机器。 选择卸载,它将从你的电脑中删除所有的yarn文件。
在windows的情况下,执行npm uninstall -g yarn后,仍然如果yarn没有卸载,然后转到“C:\Users\username\AppData\Local”并删除yarn文件夹。
关闭cmd并重新打开cmd并执行yarn。它会告诉你“yarn”不是内部或外部命令、可操作程序或批处理文件。
我用的是macOS。我在Homebrew上安装了几个版本的纱线,我用brew uninstall -force yarn卸载了它们。然后,我使用Homebrew brew install Yarn安装了最新版本的1.7.0
但当我运行哪个纱线时,它仍然返回/Users/Me/。Yarn /bin/ Yarn和Yarn——version返回0.24.6。在~/中没有提到Yarn。Bash_profile,但是我的~/。bashrc文件中包含一行export PATH="$HOME/. exe "。yarn/bin:$PATH”表示我以前必须在全球范围内安装了yarn,但我只想使用刚刚在Homebrew中安装的最新版本。
所以我通过运行npm uninstall -g Yarn全局卸载了Yarn;Rm -rf ~/。Yarn,然后编辑文件~/。将bashrc的代码行更改为export PATH="/usr/local/bin/yarn:$PATH"并运行源代码~/。bashrc更新终端会话中的PATH。然后当我运行哪个yarn时,它返回/usr/local/bin/yarn,当我运行yarn——version时,它返回 1.7.0
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>\)
推荐文章
- 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代理