# Can't build Kibana: yarn build

**URL:** <https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750>\
**Category:** Kibana\
**Created:** [May 2, 2022, 2:00pm UTC](https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750 "2022-05-02T14:00:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichelPitz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michelpitz/32/98989_2.png) [@MichelPitz](https://discuss.elastic.co/u/MichelPitz)\
**Post date:** [May 2, 2022, 2:00pm UTC](https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750/1 "2022-05-02T14:00:41Z")

</div>

Hello, I created a custom connector like Pargerduty, the connector is working localhost perfectly.  
However I cannot build the projectm I got the following error.  
Actually, even if git clone the project and do not change the code, I can't build as well. I am running git bash as administrator  
Kindly see below the command.

Kibana version is 7.16.3  
Node version is 16.13.0  
Windows 10 PRO, x64

```auto
$ yarn build
yarn run v1.22.17
$ node scripts/build --all-platforms
 info [global] Verifying environment meets requirements
   │ succ Node.js version verified
   │ succ ✓ 0 sec

 info [global] Cleaning artifacts from previous builds
   │ debg Deleting patterns: [
   │ 'C:\\Projects\\kibana\\build',
   │ 'C:\\Projects\\kibana\\target',
   │ 'C:\\Projects\\kibana\\.node_binaries'
   │ ]
   │ debg Deleted 2 files/directories
   │ succ ✓ 1 sec

 info [global] Downloading node.js builds for all platforms
   │ debg Downloading shasum values for node version 16.13.0 from https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/SHASUMS256.txt
   │ debg [1/3] Attempting download to string of [https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/SHASUMS256.txt]
   │ succ Downloaded [https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/SHASUMS256.txt]
   │ debg [1/3] Attempting download of https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/node-v16.13.0-linux-x64.tar.gz sha256
   │ debg [1/3] Attempting download of https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/node-v16.13.0-darwin-arm64.tar.gz sha256
   │ debg [1/3] Attempting download of https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/node-v16.13.0-linux-arm64.tar.gz sha256
   │ debg [1/3] Attempting download of https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/node-v16.13.0-darwin-x64.tar.gz sha256
   │ debg [1/3] Attempting download of https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/win-x64/node.exe sha256
   │ debg Downloaded https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/node-v16.13.0-darwin-x64.tar.gz and verified checksum
   │ debg Downloaded https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/node-v16.13.0-linux-arm64.tar.gz and verified checksum
   │ debg Downloaded https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/node-v16.13.0-darwin-arm64.tar.gz and verified checksum
   │ debg Downloaded https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/node-v16.13.0-linux-x64.tar.gz and verified checksum
   │ debg Downloaded https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v16.13.0/win-x64/node.exe and verified checksum
   │ succ ✓ 8 sec

 info [global] Extracting node.js builds for all platforms
   │ succ ✓ 6 sec

 info [kibana] Copying source into platform-generic build directory
   │ succ ✓ 7 sec

 info [kibana] Copying bin scripts into platform-generic build directory
   │ succ ✓ 0 sec

 info [kibana] Replacing favicons with built version
   │ succ ✓ 0 sec

 info [kibana] Creating some empty directories and files to prevent file-permission issues
   │ succ ✓ 0 sec

 info [kibana] Creating README.md file
   │ succ ✓ 0 sec

 info [kibana] Building distributable versions of Bazel packages
 info Preparing Bazel projects production build for [@elastic/apm-synthtrace, @elastic/datemath, @elastic/safer-lodash-set, @kbn/ace, @kbn/alerts, @kbn/analytics, @kbn/apm-config-loader, @kbn/apm-utils, @kbn/config, @kbn/config-schema, @kbn/crypto, @kbn/es-query, @kbn/field-types, @kbn/i18n, @kbn/interpreter, @kbn/io-ts-utils, @kbn/legacy-logging, @kbn/logging, @kbn/mapbox-gl, @kbn/monaco, @kbn/rule-data-utils, @kbn/securitysolution-autocomplete, @kbn/securitysolution-es-utils, @kbn/securitysolution-hook-utils, @kbn/securitysolution-io-ts-alerting-types, @kbn/securitysolution-io-ts-list-types, @kbn/securitysolution-io-ts-types, @kbn/securitysolution-io-ts-utils, @kbn/securitysolution-list-api, @kbn/securitysolution-list-constants, @kbn/securitysolution-list-hooks, @kbn/securitysolution-list-utils, @kbn/securitysolution-t-grid, @kbn/securitysolution-utils, @kbn/server-http-tools, @kbn/server-route-repository, @kbn/std, @kbn/timelion-grammar, @kbn/tinymath, @kbn/typed-react-router-config, @kbn/ui-framework, @kbn/ui-shared-deps-npm, @kbn/ui-shared-deps-src, @kbn/utility-types, @kbn/utils]
 info [bazel] Starting local Bazel server and connecting to it...
 info [bazel] INFO: Invocation ID: f0540502-3bdf-4363-a71a-15c573fb326e
 info [bazel] INFO: Analyzed target //packages:build (1919 packages loaded, 8397 targets configured).
 info [bazel] INFO: Found 1 target...
 info [bazel] INFO: Elapsed time: 14.898s, Critical Path: 5.56s
 info [bazel] INFO: 1 process: 1 internal.
 info [bazel]
 info All Bazel projects production builds for [@elastic/apm-synthtrace, @elastic/datemath, @elastic/safer-lodash-set, @kbn/ace, @kbn/alerts, @kbn/analytics, @kbn/apm-config-loader, @kbn/apm-utils, @kbn/config, @kbn/config-schema, @kbn/crypto, @kbn/es-query, @kbn/field-types, @kbn/i18n, @kbn/interpreter, @kbn/io-ts-utils, @kbn/legacy-logging, @kbn/logging, @kbn/mapbox-gl, @kbn/monaco, @kbn/rule-data-utils, @kbn/securitysolution-autocomplete, @kbn/securitysolution-es-utils, @kbn/securitysolution-hook-utils, @kbn/securitysolution-io-ts-alerting-types, @kbn/securitysolution-io-ts-list-types, @kbn/securitysolution-io-ts-types, @kbn/securitysolution-io-ts-utils, @kbn/securitysolution-list-api, @kbn/securitysolution-list-constants, @kbn/securitysolution-list-hooks, @kbn/securitysolution-list-utils, @kbn/securitysolution-t-grid, @kbn/securitysolution-utils, @kbn/server-http-tools, @kbn/server-route-repository, @kbn/std, @kbn/timelion-grammar, @kbn/tinymath, @kbn/typed-react-router-config, @kbn/ui-framework, @kbn/ui-shared-deps-npm, @kbn/ui-shared-deps-src, @kbn/utility-types, @kbn/utils] are complete
   │ERROR failure 16 sec
   │ERROR Error: EPERM: operation not permitted, rename 'C:\Projects\kibana\build\kibana\packages\elastic-apm-synthtrace\package.json.1352462217' -> 'C:\Projects\kibana\build\kibana\packages\elastic-apm-synthtrace\package.json'

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:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [May 2, 2022, 6:44pm UTC](https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750/2 "2022-05-02T18:44:51Z")

</div>

Hi @MichelPitz ,

Currently I don’t think our build tasks are working on windows natively. Could you please try to build it using WSL2 please?

Cheers

---

<div class="post-metadata">

**Author:** ![MichelPitz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michelpitz/32/98989_2.png) [@MichelPitz](https://discuss.elastic.co/u/MichelPitz)\
**Post date:** [May 3, 2022, 8:33am UTC](https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750/3 "2022-05-03T08:33:12Z")

</div>

Hi, I installed WSL and tried today

WSL 2  
Ubuntu 22.04

Got the same error:

```auto
 info All Bazel projects production builds for [@elastic/apm-synthtrace, @elastic/datemath, @elastic/safer-lodash-set, @kbn/ace, @kbn/alerts, @kbn/analytics, @kbn/apm-config-loader, @kbn/apm-utils, @kbn/config, @kbn/config-schema, @kbn/crypto, @kbn/es-query, @kbn/field-types, @kbn/i18n, @kbn/interpreter, @kbn/io-ts-utils, @kbn/legacy-logging, @kbn/logging, @kbn/mapbox-gl, @kbn/monaco, @kbn/rule-data-utils, @kbn/securitysolution-autocomplete, @kbn/securitysolution-es-utils, @kbn/securitysolution-hook-utils, @kbn/securitysolution-io-ts-alerting-types, @kbn/securitysolution-io-ts-list-types, @kbn/securitysolution-io-ts-types, @kbn/securitysolution-io-ts-utils, @kbn/securitysolution-list-api, @kbn/securitysolution-list-constants, @kbn/securitysolution-list-hooks, @kbn/securitysolution-list-utils, @kbn/securitysolution-t-grid, @kbn/securitysolution-utils, @kbn/server-http-tools, @kbn/server-route-repository, @kbn/std, @kbn/timelion-grammar, @kbn/tinymath, @kbn/typed-react-router-config, @kbn/ui-framework, @kbn/ui-shared-deps-npm, @kbn/ui-shared-deps-src, @kbn/utility-types, @kbn/utils] are complete
   │ERROR failure 49 min 49 sec
   │ERROR Error: EACCES: permission denied, rename '/mnt/c/Projects/Kibana/build/kibana/packages/elastic-apm-synthtrace/package.json.1047703173' -> '/mnt/c/Projects/Kibana/build/kibana/packages/elastic-apm-synthtrace/package.json'

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
petrypmi@petrypmi:/mnt/c/Projects/Kibana$

```

---

<div class="post-metadata">

**Author:** ![MichelPitz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michelpitz/32/98989_2.png) [@MichelPitz](https://discuss.elastic.co/u/MichelPitz)\
**Post date:** [May 3, 2022, 12:39pm UTC](https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750/4 "2022-05-03T12:39:27Z")

</div>

I changed the project folder from c:/Projects to WSL folder \wsl$\Ubuntu-22.04\home\petrypmi\kibana.  
Used command "yarn build --skip-os-packages" and the error is gone, will inform soon If I can start kibana

---

<div class="post-metadata">

**Author:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [May 3, 2022, 5:09pm UTC](https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750/5 "2022-05-03T17:09:05Z")

</div>

@MichelPitz thats correct!

To add on that there is a chance for the build to went through after [chore(NA): adds support for bazel packages to live anywhere by mistic · Pull Request #130833 · elastic/kibana · GitHub](https://github.com/elastic/kibana/pull/130833) lands but I think its better for you to just use WSL2 anyways as we don't frequently build on a Windows machine. Also for the future it is possible that WSL would become our default recommendation for developing on Windows.

Cheers

---

<div class="post-metadata">

**Author:** ![MichelPitz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michelpitz/32/98989_2.png) [@MichelPitz](https://discuss.elastic.co/u/MichelPitz)\
**Post date:** [May 4, 2022, 2:58pm UTC](https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750/6 "2022-05-04T14:58:22Z")

</div>

Thank you very much for the help Tiago

---

<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:** [June 1, 2022, 2:58pm UTC](https://discuss.elastic.co/t/cant-build-kibana-yarn-build/303750/7 "2022-06-01T14:58:31Z")

</div>

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