Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Git Bash Command on Windows, yarn command not found

Writer Matthew Harrington

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.

15 Answers

If you are using Mintty (Bash) then you simply do npm install -g yarn

2

You probably just did not install yarn yet. Have a look at the yarn installation for Windows here:

3

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

then restart your PC and you should be able to run yarn from your console.

1

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.

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.

0

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.

2

Try to type yarn.cmd on git bash, it should work fine. for example: yarn.cmd --version.

I followed the official yarn installation for windows but is loading a page no found on github

so I had to the manual way which is adding the path into the environment variables

asuming you already have installed npm, if you are not sure type in the terminal npm -v

  1. install yarn on the terminal using npm install --global yarn

  2. check the yarn packages has been installed onC:\Users\yourusername\AppData\Roaming\npm\node_modules\yarn

  3. if you can see the package on your node_modules you just need to add the bin folder that is inside the yarn into your environment variables

  4. On the Windows taskbar, right-click the Windows icon and select System.

  5. In the Settings window, under Related Settings, click Advanced system settings.enter image description here

  6. On the Advanced tab, click Environment Variables.enter image description here

  7. Click on Edit and add C:\Users\yourusername\AppData\Roaming\npm\node_modules\yarnenter image description here

  8. Press ok save open a new terminal and try running yarn -v

Please check first that yarn is install or not globally

C:\Users\username\AppData\Roaming\npm\node_modules\yarn

If there is, then add this to your environment variable

C:\Users\username\AppData\Roaming\npm\node_modules\yarn\bin

Download and install yarn wizard first in order to run commands related to yarn.Click on the below link to start the download automatically:

I could reproduce the same issue on git bash. However when i tried the same in command prompt it worked!

on bash - $ yarn add axios bash: yarn: command not found

on command prompt - yarn add v1.22.5 .... [1/4] Resolving packages...

If you don't have npm, you can do the following (taken from yarn installation instructions):

curl -sS | sudo apt-key add -
echo "deb stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn

It looks like there might be an issue with Yarn and certain environments. See this GitHub issue for more details.

I had same issue and for me install yarn by the installer

From the yarn official website Yarn Official website

Use this command on macbookbrew install yarn

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy