Git Bash Command on Windows, yarn command not found

103,356

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?

  1. 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)
  2. Once the Terminal is active, install Yarn by running npm install -g yarn.

  3. Verify the installation was successful by running yarn --version.

Solution 4

What resolved this for me was repairing my Node install:

  1. Go to Add or remove programs
  2. Search for "Node.js"
  3. Choose Modify
  4. 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.

Share:
103,356
Author by

user1724708

Updated on July 09, 2022

Comments

  • 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
    Macilias over 2 years
    there is a raeal issue with yarn on windows - check out the answer by: user10517109
  • Ruslan Korkin
    Ruslan Korkin about 2 years
    Do you mean change Environment variables paths?
  • douyu
    douyu about 2 years
    @RuslanKorkin yes
  • Kerem
    Kerem almost 2 years
    it's a convenient brew install yarn on macOS
  • Vishwa almost 2 years
    i 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
    Tiko 5 months
    No need to restart PC now, just reopen terminal