# Building a Kibana distributable Plugin fails in 7.16.3

**URL:** <https://discuss.elastic.co/t/building-a-kibana-distributable-plugin-fails-in-7-16-3/295877>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [January 31, 2022, 8:43pm UTC](https://discuss.elastic.co/t/building-a-kibana-distributable-plugin-fails-in-7-16-3/295877 "2022-01-31T20:43:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kbujold\_wr](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kbujold\_wr](https://discuss.elastic.co/u/kbujold_wr)\
**Post date:** [January 31, 2022, 8:43pm UTC](https://discuss.elastic.co/t/building-a-kibana-distributable-plugin-fails-in-7-16-3/295877/1 "2022-01-31T20:43:59Z")

</div>

Hi,  
We have upgraded our plugin from 7.9.3 to 7.16.3.

I have ran these commands

```auto
yarn cache clean
yarn kbn clean

BUILD_TS_REFS_DISABLE=true yarn kbn bootstrap --no-cache --debug --verbose

cd plugins/wind
rm -Rf build/
yarn build 

```

yarn build fails with these errors below

```auto
yarn build
yarn run v1.22.15
$ yarn plugin-helpers build --kibana-version 7.16.3 --debug --verbose
$ node ../../scripts/plugin_helpers build --kibana-version 7.16.3 --debug --verbose
 debg KIBANA_CI_STATS_CONFIG environment variable not found, disabling CiStatsReporter
 info deleting the build and target directories
 debg creating build output dir [/localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/plugins/wind/build/kibana/wind]
 info running @kbn/optimizer
 │ debg [wind] bundle not cached because [cache disabled]
 │ info initialized, 0 bundles cached
 │ info starting worker [1 bundle]
 │ debg modules [NaN] work units [NaN]
 │ succ 1 bundles compiled successfully after 26.7 sec
 info copying assets from `public/assets` to build
 info copying server source into the build and converting with babel
 info running yarn to install dependencies
ERROR UNHANDLED ERROR
ERROR Error: Command failed with exit code 1: yarn install --production --pure-lockfile
      node:internal/modules/cjs/loader:936
        throw err;
        ^

      Error: Cannot find module '/localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/plugins/wind/build/preinstall_check'
          at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
          at Function.Module._load (node:internal/modules/cjs/loader:778:27)
          at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
          at node:internal/main/run_main_module:17:47 {
        code: 'MODULE_NOT_FOUND',
        requireStack: []
      }
      error Command failed with exit code 1.
      $ node ../../preinstall_check
      info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
          at makeError (/localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/node_modules/execa/lib/error.js:59:11)
          at handlePromise (/localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/node_modules/execa/index.js:114:26)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at Object.yarnInstall (/localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/node_modules/@kbn/plugin-helpers/target_node/tasks/yarn_install.js:37:3)
          at Object.run (/localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/node_modules/@kbn/plugin-helpers/target_node/cli.js:103:7)
          at /localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/node_modules/@kbn/dev-utils/target_node/run/run_with_commands.js:114:9
          at withProcRunner (/localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/node_modules/@kbn/dev-utils/target_node/proc_runner/with_proc_runner.js:31:5)
          at RunWithCommands.execute (/localdisk/designer/kbujold/myCode-wra2/cgcs-root/wrs/analytics/git/elastic/kibana/node_modules/@kbn/dev-utils/target_node/run/run_with_commands.js:103:7)
 debg CIStatsReporter committerHash: bce560392393d742e922
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
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:** ![kbujold\_wr](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kbujold\_wr](https://discuss.elastic.co/u/kbujold_wr)\
**Post date:** [February 1, 2022, 3:08pm UTC](https://discuss.elastic.co/t/building-a-kibana-distributable-plugin-fails-in-7-16-3/295877/2 "2022-02-01T15:08:12Z")

</div>

My issue got fixed. The problem was with preinstall in my package.json. I have removed it ran yarn kbn bootstrap again and yarn build

```auto
 "scripts": {
    "preinstall": "node ../../preinstall_check",

```

Thanks,  
Kris

---

<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:** [March 1, 2022, 3:08pm UTC](https://discuss.elastic.co/t/building-a-kibana-distributable-plugin-fails-in-7-16-3/295877/3 "2022-03-01T15:08:53Z")

</div>

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