Git Bash Command on Windows, yarn command not found
Solution 1
You probably just did not install yarn yet. Have a look at the yarn installation for Windows here:
https://yarnpkg.com/lang/en/docs/install/
Solution 2
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
https://yarnpkg.com/lang/en/docs/install/#windows-stable
then restart your PC and you should be able to run yarn
from your console.
Solution 3
Working in Visual Studio Code?
-
Open a new terminal
-
Click "Terminal" → "New Terminal"
or
-
Simply use ctrl+shift+` (backtick)
- (this backtick button is on the left of the 1 key and below Esc)
-
-
Once the Terminal is active, install Yarn by running
npm install -g yarn
. -
Verify the installation was successful by running
yarn --version
.
Solution 4
What resolved this for me was repairing my Node install:
- Go to Add or remove programs
- Search for "Node.js"
- Choose Modify
- Choose Next and then Repair
After doing that I was able to run yarn without issue.
Solution 5
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
.
user1724708
Updated on July 09, 2022Comments
-
user1724708 3 months
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
...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.
Thanks in advance for any assistance.
-
Macilias over 2 yearsthere is a raeal issue with yarn on windows - check out the answer by: user10517109
-
Ruslan Korkin about 2 yearsDo you mean change Environment variables paths?
-
douyu about 2 years@RuslanKorkin yes
-
Kerem almost 2 yearsit's a convenient
brew install yarn
on macOS -
Vishwa almost 2 yearsi tried to install the msi file on windows. but still said that yarn command is not found. so i tried npm install -g yarn command and it worked.
-
Tiko 5 monthsNo need to restart PC now, just reopen terminal