> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Yarn Error

## What is causing a Yarn Error?

Yarn doesn’t always perform well under heavy loads. Two common solutions are:

**Solution 1:** **Install Yarn less often**. Put `yarn install` as high up as
possible in your Layerfile so that it is cached. When creating complex workflows
that contain Yarn, run `yarn install` in the parent Layerfile.

For example, consider the following graphs:

<img src="https://mintcdn.com/webappio/s6-eR6DYSUsnelQ0/resources/yarn_install.png?fit=max&auto=format&n=s6-eR6DYSUsnelQ0&q=85&s=ddfe3a57032da1de3e821e809a3cb36a" alt="Graphic shows the benefit of using inheritance to reduce repetitive use of yarn install" width="980" height="500" data-path="resources/yarn_install.png" />

On the left, `yarn install` runs five times. On the right, `yarn install` only
runs once and then is inherited by its children. When appropriate, use the
`SPLIT` directive after running `yarn install` to reduce unnecessary repetition.

**Solution 2:** **Use npm instead**. Yarn and npm have similar speeds when they
are cached.
