Building a Kibana distributable Plugin fails in 7.16.3

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

I have ran these commands

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

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.

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

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

Thanks,
Kris

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