Error: Cannot find module '@kbn/utils'

while executing command yarn kbn bootstrap I am facing the issue , Error: Cannot find module '@kbn/utils'

----- Complete log is here
root@is-OptiPlex-5050:/home/kibana/kibana# yarn kbn bootstrap
yarn run v1.22.5
node scripts/kbn bootstrap succ [bazel_tools] all bazel tools are correctly installed info [bazel] INFO: Invocation ID: 8242e00a-efe8-47b8-8b8e-32887b7c979b info [bazel] INFO: Analyzed target @nodejs//:yarn (0 packages loaded, 0 targets configured). info [bazel] INFO: Found 1 target... info [bazel] INFO: Elapsed time: 0.166s, Critical Path: 0.09s info [bazel] INFO: 1 process: 1 internal. info [bazel] INFO: Running command line: /root/.cache/bazel/_bazel_root/59c8214d5247a4c46712ee45ad74ea44/external/nodejs_linux_amd64/bin/yarn info [bazel] info No lockfile found. info [bazel] node ./preinstall_check
info [bazel] [1/5] Validating package.json...
info [bazel] [2/5] Resolving packages...
info [bazel] warning Resolution field "@types/node@8.10.54" is incompatible with requested version "@types/node@12.12.50"
info [bazel] [3/5] Fetching packages...
info [bazel] info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info [bazel] info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info [bazel] [4/5] Linking dependencies...
info [bazel] warning " > @elastic/apm-rum-react@1.2.8" has incorrect peer dependency "react-router-dom@^4.0.0".
info [bazel] warning "@elastic/github-checks-reporter > @octokit/rest > @octokit/plugin-request-log@1.0.3" has unmet peer dependency "@octokit/core@>=3".
info [bazel] warning "@storybook/addon-storyshots > react-test-renderer@17.0.1" has incorrect peer dependency "react@17.0.1".
info [bazel] warning " > react-monaco-editor@0.41.2" has incorrect peer dependency "@types/react@^17.x".
info [bazel] warning " > react-monaco-editor@0.41.2" has incorrect peer dependency "react@^17.x".
info [bazel] [5/5] Building fresh packages...
info [bazel] success Saved lockfile.
info [bazel] INFO: Invocation ID: 27877a14-912f-4e80-aeca-393a85c1e05a
info [bazel] INFO: Analyzed target //packages:build (1 packages loaded, 1 target configured).
info [bazel] INFO: Found 1 target...
info [bazel] INFO: Elapsed time: 0.533s, Critical Path: 0.10s
info [bazel] INFO: 1 process: 1 internal.
info [bazel]
succ yarn.lock analysis completed without any issues
info [@kbn/apm-utils] running [kbn:bootstrap] script
info [@kbn/config-schema] running [kbn:bootstrap] script
info [@kbn/tinymath] running [kbn:bootstrap] script
info [@kbn/utility-types] running [kbn:bootstrap] script
succ [@kbn/tinymath] bootstrap complete
succ [@kbn/apm-utils] bootstrap complete
succ [@kbn/utility-types] bootstrap complete
succ [@kbn/config-schema] bootstrap complete
info [@kbn/babel-code-parser] running [kbn:bootstrap] script
info [@kbn/std] running [kbn:bootstrap] script
info [@kbn/utils] running [kbn:bootstrap] script
succ [@kbn/utils] bootstrap complete
succ [@kbn/std] bootstrap complete
succ [@kbn/babel-code-parser] bootstrap complete
info [@kbn/apm-config-loader] running [kbn:bootstrap] script
info [@kbn/dev-utils] running [kbn:bootstrap] script
info [@kbn/legacy-logging] running [kbn:bootstrap] script
info [@kbn/logging] running [kbn:bootstrap] script
succ [@kbn/logging] bootstrap complete
succ [@kbn/apm-config-loader] bootstrap complete
succ [@kbn/legacy-logging] bootstrap complete
succ [@kbn/dev-utils] bootstrap complete
info [@kbn/ace] running [kbn:bootstrap] script
info [@kbn/analytics] running [kbn:bootstrap] script
info [@kbn/config] running [kbn:bootstrap] script
info [@kbn/es] running [kbn:bootstrap] script
succ [@kbn/config] bootstrap complete
info [@kbn/i18n] running [kbn:bootstrap] script
succ [@kbn/es] bootstrap complete
info [@kbn/plugin-generator] running [kbn:bootstrap] script
succ [@kbn/analytics] bootstrap complete
info [@kbn/storybook] running [kbn:bootstrap] script
succ [@kbn/ace] bootstrap complete
info [@kbn/telemetry-tools] running [kbn:bootstrap] script
succ [@kbn/i18n] bootstrap complete
succ [@kbn/telemetry-tools] bootstrap complete
succ [@kbn/plugin-generator] bootstrap complete
succ [@kbn/storybook] bootstrap complete
info [@kbn/docs-utils] running [kbn:bootstrap] script
info [@kbn/interpreter] running [kbn:bootstrap] script
info [@kbn/monaco] running [kbn:bootstrap] script
succ [@kbn/interpreter] bootstrap complete
succ [@kbn/docs-utils] bootstrap complete
succ [@kbn/monaco] bootstrap complete
info [@kbn/ui-shared-deps] running [kbn:bootstrap] script
succ [@kbn/ui-shared-deps] bootstrap complete
info [@kbn/optimizer] running [kbn:bootstrap] script
succ [@kbn/optimizer] bootstrap complete
info [@kbn/plugin-helpers] running [kbn:bootstrap] script
info [@kbn/test] running [kbn:bootstrap] script
(node:13374) UnhandledPromiseRejectionWarning: Error: Cannot find module '@kbn/utils'
at webpackEmptyContext (/home/kibana/kibana/packages/kbn-pm/dist/index.js:63260:10)
at CiStatsReporter.getKibanaUuid (/home/kibana/kibana/packages/kbn-pm/dist/index.js:59733:55)
at CiStatsReporter.timings (/home/kibana/kibana/packages/kbn-pm/dist/index.js:59663:68)
at runCommand (/home/kibana/kibana/packages/kbn-pm/dist/index.js:59570:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Module.run (/home/kibana/kibana/packages/kbn-pm/dist/index.js:242:3)
(Use node --trace-warnings ... to show where the warning was created)
(node:13374) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line options | Node.js v15.11.0 Documentation). (rejection id: 2)
(node:13374) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 146.64s.

Hello,

You could try a yarn kbn clean first and then try yarn kbn bootstrap again. It's possible something isn't getting cleaned up or overwritten like it should be.

For reference, see Getting started | Kibana Guide [7.x] | Elastic

Regards,
Aaron

Thanks for your response, issue still persists after executing command yarn kbn clean
Rather issue is resolved after checkout latest source from git. :slightly_smiling_face:

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