title: JHipster - Yarn Build failure
body: <p>Using Jhipster v5.0.1 and Angular v6.0.0</p>
  
  <p><strong>Goal</strong></p>
  
  <p>I want to do a yarn build so that my scss file is taken into account but it fails:</p>
  
  <p><strong>In the terminal :</strong></p>
  
  <pre><code>C:\Users\clari\Documents\ManuelaTechValley\crafrontmanu&gt;yarn build
  yarn run v1.5.1
  $ yarn run webpack:prod
  $ yarn run cleanup &amp;&amp; yarn run webpack:prod:main &amp;&amp; yarn run clean-www
  $ rimraf target/{aot,www}
  'rimraf' n’est pas reconnu en tant que commande interne
  ou externe, un programme exécutable ou un fichier de commandes.
  error An unexpected error occurred: "Command failed.
  Exit code: 1
  Command: C:\\WINDOWS\\system32\\cmd.exe
  Arguments: /d /s /c rimraf target/{aot,www}
  Directory: C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu
  Output:
  ".
  info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu\\yarn-error.log".
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  </code></pre>
  
  <p><strong>In the yarn-error :</strong></p>
  
  <pre><code>Trace: 
    Error: Command failed.
    Exit code: 1
    Command: C:\WINDOWS\system32\cmd.exe
    Arguments: /d /s /c yarn run webpack:prod
    Directory: C:\Users\clari\Documents\Manuela\crafrontmanu
    Output:
  
        at ProcessTermError.MessageError (C:\Program Files (x86)\Yarn\lib\cli.js:186:110)
        at new ProcessTermError (C:\Program Files (x86)\Yarn\lib\cli.js:226:113)
        at ChildProcess.&lt;anonymous&gt; (C:\Program Files (x86)\Yarn\lib\cli.js:30281:17)
        at ChildProcess.emit (events.js:180:13)
        at maybeClose (internal/child_process.js:936:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
  </code></pre>
  
  <p><strong>EDIT 1 :</strong></p>
  
  <p>I found this issue. <a href="https://github.com/yarnpkg/yarn/issues/5481" rel="nofollow noreferrer">https://github.com/yarnpkg/yarn/issues/5481</a>
  I wonder if this is my problem, the reason why it doesn't find some dependencies for building. I have the version 1.5.1 but if I try to update, my terminal answer already up-to-date... </p>
  
  <p><strong>EDIT 2 :</strong></p>
  
  <p>I suppressed all node-modules and did a yarn install again. The rimraf prob is not there anymore. But still, it doesn't work. </p>
  
  <pre><code>    Trace: 
    Error: Command failed.
    Exit code: 1
    Command: C:\WINDOWS\system32\cmd.exe
    Arguments: /d /s /c yarn run webpack:prod
    Directory: C:\Users\clari\Documents\Manuela\crafrontmanu
    Output: ".
  
    at ProcessTermError.MessageError (C:\Program Files (x86)\Yarn\lib\cli.js:186:110)
    at new ProcessTermError (C:\Program Files (x86)\Yarn\lib\cli.js:226:113)
    at ChildProcess.&lt;anonymous&gt; (C:\Program Files (x86)\Yarn\lib\cli.js:30281:17)
    at ChildProcess.emit (events.js:180:13)
    at maybeClose (internal/child_process.js:936:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
  
  
  C:\Users\clari\Documents\Manuela\crafrontmanu&gt;yarn build
  yarn run v1.5.1
  $ yarn run webpack:prod
  $ yarn run cleanup &amp;&amp; yarn run webpack:prod:main &amp;&amp; yarn run clean-www
  $ rimraf target/{aot,www}
  $ yarn run webpack --config webpack/webpack.prod.js --profile
  $ node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config webpack/webpack.prod.js --profile
  (node:12788) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
  Hash: 83726fc3895998baed92
  Version: webpack 4.8.0
  Time: 8976ms
  Built at: 2018-10-02 15:01:08
   7 assets
  Entrypoint polyfills = app/polyfills.83726fc3895998baed92.bundle.js
  Entrypoint global = app/global.83726fc3895998baed92.bundle.js content/global.83726fc3895998baed92.css
  Entrypoint main = app/main.83726fc3895998baed92.bundle.js
  [0] ./src/main/webapp/app/app.main.ts 0 bytes {0} [built]
      factory:4418ms building:4087ms = 8505ms
  [1] ./src/main/webapp/app/polyfills.ts 0 bytes {2} [built]
      factory:4418ms building:4072ms = 8490ms
  [5] ./node_modules/css-loader!./src/main/webapp/content/css/global.css 2.17 KiB [built]
      [6] -&gt; factory:625ms building:728ms = 1353ms
  [6] ./src/main/webapp/content/css/global.css 41 bytes [built]
      + 3 hidden modules
  
  
  error An unexpected error occurred: "Command failed.
  Exit code: 2
  Command: C:\\WINDOWS\\system32\\cmd.exe
  Arguments: /d /s /c node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js --config webpack/webpack.prod.js --profile
  Directory: C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu
  Output:
  ".
  info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu\\yarn-error.log".
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  error An unexpected error occurred: "Command failed.
  Exit code: 1
  Command: C:\\WINDOWS\\system32\\cmd.exe
  Arguments: /d /s /c yarn run webpack --config webpack/webpack.prod.js --profile
  Directory: C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu
  Output:
  ".
  info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu\\yarn-error.log".
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  error An unexpected error occurred: "Command failed.
  Exit code: 1
  Command: C:\\WINDOWS\\system32\\cmd.exe
  Arguments: /d /s /c yarn run cleanup &amp;&amp; yarn run webpack:prod:main &amp;&amp; yarn run clean-www
  Directory: C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu
  Output:
  ".
  info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu\\yarn-error.log".
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  error An unexpected error occurred: "Command failed.
  Exit code: 1
  Command: C:\\WINDOWS\\system32\\cmd.exe
  Arguments: /d /s /c yarn run webpack:prod
  Directory: C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu
  Output:
  ".
  info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\clari\\Documents\\Manuela\\crafrontmanu\\yarn-error.log".
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  </code></pre>
  
  <p><strong>EDIT 3 :</strong></p>
  
  <p>Try to launch prod Build using mvnw Pprod. The build also fails. </p>
  
  <pre><code>    [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 01:55 min
  [INFO] Finished at: 2018-10-02T16:29:48+02:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (webpack build prod) on project crafrontmanu: Failed to run task: 'yarn run webpack:prod' failed. org.apache.commons.exec.ExecuteException: Process exited with an error:
   1 (Exit value: 1) -&gt; [Help 1]
  [ERROR]
  </code></pre>
  
  <p><strong>EDIT 4 :</strong></p>
  
  <p>There were errors that I fixed. It was not preventing yarn start that's why I didn't pay attention to it before but it prevented yarn build apparently. Problem solved then. Thks for your time.</p>
  
  <p>Thanks,</p>
  
  <p>Manu</p>