# Yarn build results in "error Command failed with exit code 1." error

**URL:** <https://discuss.elastic.co/t/yarn-build-results-in-error-command-failed-with-exit-code-1-error/302597>\
**Category:** Kibana\
**Created:** [April 18, 2022, 8:07am UTC](https://discuss.elastic.co/t/yarn-build-results-in-error-command-failed-with-exit-code-1-error/302597 "2022-04-18T08:07:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![niveditakathal](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@niveditakathal](https://discuss.elastic.co/u/niveditakathal)\
**Post date:** [April 18, 2022, 8:07am UTC](https://discuss.elastic.co/t/yarn-build-results-in-error-command-failed-with-exit-code-1-error/302597/1 "2022-04-18T08:07:56Z")

</div>

Hi Experts,  
I am trying to build my cutome kibana pluging using yarn build and getting "error Command failed with exit code 1." error . Can someone please assist me on how I can fix it ?

```auto
[@kbn/optimizer/node] GET error [sourceMaps/6ba17a6a:node:internal/streams/end-of-stream]: Error: Invalid parameter, which on MacOS is often due to more transactions than available robust locked semaphors (see docs for more info)
    at renewReadTxn (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:143:18)
    at LMDBStore.getString (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:423:58)
    at LMDBStore.get (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:445:22)
    at Cache.safeGet (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/cache.js:128:24)
    at Cache.getSourceMap (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/cache.js:105:22)
    at Array.retrieveSourceMap (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/node_auto_tranpilation.js:162:25)
    at /opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:65:24
    at mapSourcePosition (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:196:21)
    at wrapCallSite (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:377:20)
    at prepareStackTrace (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:426:39)
    at Function.csPrepareStackTrace (/opt/tryfour/kibana/node_modules/error-callsites/index.js:52:10)
    at maybeOverridePrepareStackTrace (node:internal/errors:141:29)
    at prepareStackTrace (node:internal/errors:115:5)
    at checkError (node:internal/streams/destroy:19:9)
    at Transform.destroy (node:internal/streams/destroy:49:3)
    at Object.destroyer (node:internal/streams/destroy:313:59)
[@kbn/optimizer/node] GET error [sourceMaps/6ba17a6a:node:internal/errors]: Error: Invalid parameter, which on MacOS is often due to more transactions than available robust locked semaphors (see docs for more info)
    at renewReadTxn (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:143:18)
    at LMDBStore.getString (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:423:58)
    at LMDBStore.get (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:445:22)
    at Cache.safeGet (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/cache.js:128:24)
    at Cache.getSourceMap (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/cache.js:105:22)
    at Array.retrieveSourceMap (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/node_auto_tranpilation.js:162:25)
    at /opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:65:24
    at mapSourcePosition (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:196:21)
    at wrapCallSite (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:377:20)
    at prepareStackTrace (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:426:39)
    at Function.csPrepareStackTrace (/opt/tryfour/kibana/node_modules/error-callsites/index.js:52:10)
    at maybeOverridePrepareStackTrace (node:internal/errors:141:29)
    at prepareStackTrace (node:internal/errors:115:5)
    at checkError (node:internal/streams/destroy:19:9)
    at Transform.destroy (node:internal/streams/destroy:49:3)
    at Object.destroyer (node:internal/streams/destroy:313:59)
   │ERROR failure 0 sec
   │ERROR Error: Premature close
   │ at new NodeError (node:internal/errors:371:5)
   │ at Socket.onclose (node:internal/streams/end-of-stream:135:30)
   │ at Socket.emit (node:events:402:35)
   │ at Pipe.<anonymous> (node:net:687:12)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

```

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [April 20, 2022, 4:58pm UTC](https://discuss.elastic.co/t/yarn-build-results-in-error-command-failed-with-exit-code-1-error/302597/2 "2022-04-20T16:58:17Z")

</div>

Can you delete the `data/node_auto_transpilation_cache_v3` directory and see if that helps? Also stop any command that you were running when this error shows up.

---

<div class="post-metadata">

**Author:** ![niveditakathal](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@niveditakathal](https://discuss.elastic.co/u/niveditakathal)\
**Post date:** [April 21, 2022, 10:54am UTC](https://discuss.elastic.co/t/yarn-build-results-in-error-command-failed-with-exit-code-1-error/302597/3 "2022-04-21T10:54:45Z")

</div>

Thanks a lot @Marius_Dragomir ,

I delete the "node\_auto\_transpilation\_cache\_v3" directory from data folder; however I am still getting below mentioned error

```auto
   '/opt/tryfour/kibana/build/kibana/x-pack/plugins/drilldowns/url_drilldown/target/public/metrics.json',
   │ '/opt/tryfour/kibana/build/kibana/plugins/mycustom_test_plugin/target/public/metrics.json'
   │ ]
   │ debg Deleted 121 files/directories
   │ succ ✓ 35 min 8 sec

 info [kibana] Transpiling sources with babel
[@kbn/optimizer/node] GET error [sourceMaps/6ba17a6a:node_modules/babel-plugin-add-module-exports/lib/index.js]: Error: Invalid parameter, which on MacOS is often due to more transactions than available robust locked semaphors (see docs for more info)
    at renewReadTxn (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:143:18)
    at LMDBStore.getString (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:423:58)
    at LMDBStore.get (/opt/tryfour/kibana/node_modules/lmdb-store/index.js:445:22)
    at Cache.safeGet (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/cache.js:128:24)
    at Cache.getSourceMap (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/cache.js:105:22)
    at Array.retrieveSourceMap (/opt/tryfour/kibana/node_modules/@kbn/optimizer/target_node/node/node_auto_tranpilation.js:162:25)
    at /opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:65:24
    at mapSourcePosition (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:196:21)
    at wrapCallSite (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:377:20)
    at prepareStackTrace (/opt/tryfour/kibana/node_modules/source-map-support/source-map-support.js:426:39)
    at Function.csPrepareStackTrace (/opt/tryfour/kibana/node_modules/error-callsites/index.js:52:10)
    at maybeOverridePrepareStackTrace (node:internal/errors:141:29)
    at prepareStackTrace (node:internal/errors:115:5)
    at extendedTrace (/opt/tryfour/kibana/node_modules/@babel/template/lib/builder.js:68:15)
    at /opt/tryfour/kibana/node_modules/@babel/template/lib/builder.js:25:14
    at addModuleExportsDefaults (/opt/tryfour/kibana/node_modules/babel-plugin-add-module-exports/lib/index.js:30:29)
[BABEL] Note: The code generator has deoptimised the styling of /opt/tryfour/kibana/build/kibana/x-pack/plugins/canvas/shareable_runtime/build/kbn_canvas.js as it exceeds the max of 500KB.

```

Also , I have noticed that the directory **node\_auto\_transpilation\_cache\_v3** created again while running the yarn build cmd

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/a/eada30c3da108545d1d9be491f28e3cd9bd4ccbb.png)

Do you know the consequence of deleting the kibana/node\_modules/@kbn/optimizer directory ?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/f/ef1b434b504914f2d5a85c64f2d3f90ae139e857.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 19, 2022, 10:54am UTC](https://discuss.elastic.co/t/yarn-build-results-in-error-command-failed-with-exit-code-1-error/302597/4 "2022-05-19T10:54:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
