SilverWebBuzz

 Join Silver Webbuzz at GITEX Global 2023 – The Year to Imagine AI in Everything. Meet us.

ZSH: Command Not Found: Yarn

zsh command not found yarn - Silver WebBuzz
Get in Touch With Us
Submitting the form below will ensure a prompt response from us.

    ZSH: Command Not Found: Yarn 

    The error message zsh: command not found: yarn indicates that the terminal cannot find the yarn command, meaning that Yarn (a JavaScript package manager) is not installed or not correctly set up in your system’s PATH.

    Here are the steps to install or fix the issue:

    1. Install Yarn

    If Yarn is not installed on your system, you can install it by following these steps:

    On macOS:

    If you’re using Homebrew, you can install Yarn with the following command:

    bash

    brew install yarn

    If you don’t have Homebrew, install it first by running:

    bash

    /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

    Then install Yarn:

    bash

    brew install yarn

    On Linux:

    For Ubuntu/Debian based systems:

    bash

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add –
    echo “deb https://dl.yarnpkg.com/debian/ stable main” | sudo tee /etc/apt/sources.list.d/yarn.list
    sudo apt update && sudo apt install yarn

    For CentOS/RHEL based systems:

    bash

    curl -sL https://dl.yarnpkg.com/rpm/yarn-1.22.19-1.x86_64.rpm | sudo rpm -ivh
    sudo dnf install yarn

    On Windows:

    You can install Yarn via the official website or using Chocolatey:

    bash

    choco install yarn

    Or download the installer from the official Yarn website.

    2. Verify Yarn Installation

    Once installed, verify that Yarn was successfully installed by running:

    bash

    yarn –version

    This should return the installed version of Yarn.

    3. Add Yarn to Your PATH (if necessary)

    If Yarn is already installed but still not recognized, you might need to ensure it’s correctly added to your system’s PATH.

    For macOS/Linux: Check the installation path of Yarn by running:

    bash

    which yarn

    If it doesn’t return anything, you may need to manually add Yarn’s installation directory to your PATH.
    For example, add this to your ~/.zshrc (or ~/.bashrc if you’re using Bash):

    bash

    export PATH=”$PATH:/path/to/yarn/bin”

    After adding it, run:

    bash

    source ~/.zshrc

    or

    bash

    source ~/.bashrc

    For Windows: Make sure the Yarn bin directory is added to the PATH in the Environment Variables settings.

    4. Reopen Terminal

    After installation or fixing the PATH, reopen your terminal and run yarn again to check if it’s recognized.

    About Author

    Bhavik Koradiya is the CEO / Co. Founder of Silver WebBuzz Pvt. Ltd. Having 18+ years Experience in LAMP technology. I have expert in Magento, Joomla, WordPress, Opencart, e-commerce and many other open source. Specialties: Magento, WordPress, OpenCart, Joomla, JQuery, Any Open source.

    Scroll to Top