# Error Yarn build:production - works with yarn build

**URL:** https://discourse.roots.io/t/error-yarn-build-production-works-with-yarn-build/11423
**Category:** sage
**Tags:** sage9
**Created:** 2018-01-25T08:42:29Z
**Posts:** 5

## Post 1 by @dghez — 2018-01-25T08:42:29Z

Hi everyone!  
I’m working on Sage9 `9.0.0- beta 4` and I’m currently trying to do the files for the production.  
I usually run `yarn run build` for testing some stuff. Now I did run that command and everything works fine, then I run `yarn run build:production` and it gives me back an error, ` Command failed with exit code 2.` without any other info.  
How can I figure out what is wrong? It’s kinda disarming get an error without any other reference.  
Any idea?  
Thanks everyone :slight_smile:

 ![36](https://discourse.roots.io/uploads/default/original/2X/0/01803a44d8b2dcf889a06ccae04ad811a60d8819.png)

---

## Post 2 by @Stephen — 2018-01-25T11:09:51Z

Maybe related:

> [@Yarn Build Error (exit code 2)](https://discourse.roots.io/t/yarn-build-error-exit-code-2/10225):
>
> Hey guys! Haven’t been on here much lately. Good to be back. I spun up a fresh install today. For not having done so for a few months, it went insanely smooth. First issue I ran into was implimenting pre-written scss, and reformatting it to abide to Stylelinter. None of the “–fix” commands were working for me so I just did it manually. I got it all cleaned up, but now I was missing main.scss entirely. I ran yarn, yarn clean, yarn build, yarn run build– and on any build task I get: yarn run …

---

## Post 3 by @dghez — 2018-01-25T17:09:16Z

Seriously? I made a search before posting this new thread, even in the suggested while posting it didn’t show up.

It actually solved my problem :slight_smile:  
It was a problem in a scss file with a sass variable declared incorrectly.  
Btw thanks and please **sorry** for this duplicate.

---

## Post 4 by @Stephen — 2018-01-25T21:55:48Z

I actually found it via Google…

The most important thing is that you got it fixed :slight_smile:

---

## Post 5 by @masoninthesis — 2018-01-25T22:03:20Z

Yeah, imo Google is the best way to search this forum. My search usually looks something like:

`discourse.roots “error codes here”`

Glad you got it sorted out.
