Build Failure unable to find yarn

Builds have started failing for all of my sites today. There were no changes to the netlify.toml file and yarn.lock is committed. There was a successful build for this site last night.

https://loving-jones-0314f9.netlify.app

2:26:55 PM: │ 1. build.command from netlify.toml │
2:26:55 PM: └────────────────────────────────────┘
2:26:55 PM: ​
2:26:55 PM: $ yarn build
2:26:55 PM: bash: yarn: command not found
2:26:55 PM: ​
2:26:55 PM: ┌─────────────────────────────┐
2:26:55 PM: │   "build.command" failed    │
2:26:55 PM: └─────────────────────────────┘
2:26:55 PM: ​
2:26:55 PM:   Error message
2:26:55 PM:   Command failed with exit code 127: yarn build
2:26:55 PM: ​
2:26:55 PM:   Error location
2:26:55 PM:   In build.command from netlify.toml:
2:26:55 PM:   yarn build

This was caused due to the build.base was an empty string.
[build]
command = “yarn build”
publish = “public”
base = “”

Fix - Add base directory.

1 Like

thanks for posting your solution! glad its working. :smiley: