node.js Windows 上的 Git Bash 命令,找不到 yarn 命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48997825/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git Bash Command on Windows, yarn command not found
提问by user1724708
I following this online tutorial on downloading and installing web files from GIT HUB. I got down to the topic: Starting Our Static Website, there I'm prompted to enter the commands to download and install the web files. However, when I enter the command yarn install, I get the following prompt: bash: yarn: command not found
我正在关注这个关于从 GIT HUB 下载和安装 Web 文件的在线教程。我进入主题:启动我们的静态网站,在那里提示我输入命令以下载和安装 Web 文件。但是,当我输入命令 yarn install 时,出现以下提示:bash: yarn: command not found
...My question is has anyone else encountered this problem and if so, how was it resolved? I'm using GIT Bash command prompt on Windows 10.
...我的问题是有没有其他人遇到过这个问题,如果有,它是如何解决的?我在 Windows 10 上使用 GIT Bash 命令提示符。
Thanks in advance for any assistance.
在此先感谢您的帮助。
采纳答案by xtj7
You probably just did not install yarn yet. Have a look at the yarn installation for Windows here:
你可能只是还没有安装纱线。在此处查看 Windows 的纱线安装:
回答by
If you are using Mintty (Bash) then you simply do npm install -g yarn
如果您使用的是 Mintty (Bash),那么您只需执行 npm install -g yarn
回答by Lukas
The official Yarn setup does not tell you you need to restart your computer, but you actually have to before you can use it from your shell. So, install it from
官方 Yarn 设置不会告诉您需要重新启动计算机,但实际上必须重新启动才能从 shell 中使用它。所以,从安装它
https://yarnpkg.com/lang/en/docs/install/#windows-stable
https://yarnpkg.com/lang/en/docs/install/#windows-stable
then restart your PC and you should be able to run yarnfrom your console.
然后重新启动您的 PC,您应该可以yarn从控制台运行。
回答by Fishdou
If you install yarn through MSI on windows10, and the software installed on C:\Program Files (x86)\Yarn\bin, but the path set in C:\Users\{username}\AppData\Local\Yarn\.bin, so change the path(both user and system) to C:\Program Files (x86)\Yarn\bin.
如果安装通过MSI在windows10纱,并安装的软件C:\Program Files (x86)\Yarn\bin,但在路径设置C:\Users\{username}\AppData\Local\Yarn\.bin,所以更改路径(用户和系统)C:\Program Files (x86)\Yarn\bin。
回答by Daniel Danielecki
Working on Visual Studio Code?
使用 Visual Studio Code?
Click "Terminal" -> "New Terminal" or simply "CTRL+SHIFT+(the button on the left from 1 and below Esc - can't write it here, because it creates a code block on Stack Overflow)" (Mac/Windows) and once the Terminal will be active install Yarn by running npm install -g yarn.
单击“终端”->“新建终端”或简单地“ CTRL+SHIFT+(从 1 到 Esc 下方的左侧按钮 - 不能在这里写,因为它会在堆栈溢出中创建一个代码块)”(Mac/Windows ) 并且一旦终端处于活动状态,运行npm install -g yarn.
Verify in the same Terminal once installation will be done by running yarn --version.
安装完成后,在同一个终端中验证yarn --version。
回答by GSangram
Download and install yarn wizardfirst in order to run commands related to yarn.Click on the below link to start the download automatically:
https://yarnpkg.com/latest.msi
先下载安装yarn wizard,运行相关命令yarn。点击下面链接自动开始下载:https:
//yarnpkg.com/latest.msi

