Error while running 6.8 yarn kbn bootstrap

Hello I am trying to get a 6.8 development environment up and running in a isolated network.
I did a git pull and checkout 6.8 then run yarn kbn bootstrap it downloads all the dependacies fine but when it tries to build @kbn/config-schema

The cut down error. since I cant copy and past the full error messgae

yarn build
tsc
...
../../node_modules/@types/react-redux/index.d.ts(97,64): error TS264: Namespace 'global.JSX' has no exported member 'LibraryManagedAttributes'.
../../node_modules/lib/lib.es2019.object.d.ts(28,81): error TS2322: Type 'string | number | symbol' is not assignable to type 'string'.
  Type 'number' is not assignable to type 'string'.

Any help be appricated.

Hi there Robert!

I'm having a hard time reproducing this. Can you try running yarn kbn clean and then re-running yarn kbn bootstrap?

If that fails...Are you sure that bootstrap is failing on the @kbn/config-schema package? I'm asking because that package doesn't depend on React at all, so I'm surprised by the error you're seeing. What happens if you run yarn build from the packages/kbn-config-schema directory?

If you can share any more of the error output, that may be helpful.

I ran the clean and bootstrap command again same error:

Installs completed, linking package executables:

[x-pack] plugin-hlpers -> ../packages/kbn-plugin-helpers/bin/plugin-helpers.js

@elastic/datemath: $ yarn build --quiet
@kbn/config-schema: $ yarn build
@elastic/datemath: $ babel src --out-dir target --copy-files --quiet
@kbn/config-schema: $ tsc
@kbn/config-schema: ../../node_modules/@types/angular-mocks/node_modeles/@types/angular/jqlite.d.ts(29,5): error TS2375: Duplicate number index signature.
@kbn/config-schema: ../../node_modules/@types/angular-mocks/node_modeles/@types/angular/jqlite.d.ts(809,5): error TS2717: Subsequent property declarations must have the same type. Property 'char' must be of type 'any', but here has type 'string'.
@kbn/config-schema: ../../node_modules/@types/angular-mocks/node_modeles/@types/angular/jqlite.d.ts(812,5): error TS2717: Subsequent property declarations must have the same type. Property 'char' must be of type 'any', but here has type 'string'.
@kbn/config-schema: ../../node_modules/@types/angular-mocks/node_modeles/@types/angular/jqlite.d.ts(828,5): error TS2374: Duplicate string index signature
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(67,20): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(67,35): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(72,35): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(72,50): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(77,40): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(77,57): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(82,40): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(82,57): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(87,18): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(92,26): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(150,25): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(155,16): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(160,17): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(165,19): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(170,20): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/enzyme/index.d.ts(698,40): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/jquery/legacy.d.ts(171,5): error error TS2717: Subsequent property declarations must have the same type. Property 'char' must be of type 'any', but here has type 'string'.
@kbn/config-schema: ../../node_modules/@types/jquery/legacy.d.ts(174,5): error error TS2717: Subsequent property declarations must have the same type. Property 'char' must be of type 'any', but here has type 'string'.
@kbn/config-schema: ../../node_modules/@types/react-dom/index.d.ts(90,18): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/react-dom/index.d.ts(90,18): error TS2314: Generic type 'ReactElement<P>' requires 1 type argument(s).
@kbn/config-schema: ../../node_modules/@types/react-redux/index.d.ts(97,64): error TS264: Namespace 'global.JSX' has no exported member 'LibraryManagedAttributes'.
@kbn/config-schema: ../../node_modules/lib/lib.es2019.object.d.ts(28,81): error TS2322: Type 'string | number | symbol' is not assignable to type 'string'.
@kbn/config-schema:  Type 'number' is not assignable to type 'string'.
@kbn/config-schema: info Visit Https://yarnpkg.com/en/docs/cli/run for documentation about this command
x @kbn/config-schema: error Command failed with exit code 2.
@kbn/config-schema: info Visit Https://yarnpkg.com/en/docs/cli/run for documentation about this command
x @kbn/config-schema: error Command failed with exit code 1.

[bootstrap] faild:
Error: Command failed: yarn run kbn:bootstrap
error Command failed with exit code 2.
error Command failed with exit code 1.

when I run yarn build from packages/kbn-config-schema I get the same set if errors just formatted differnetly
it looks like even running yarn from the packages dir it looking at the node_modules from the root repo as if I am missing some config to tell yarn / tsc to ignore thate dir

Ok a few more ideas:

  • Has the yarn.lock file changed at all? Make sure you have the same one from upstream with no changes, then re-run bootstrap.
  • Which version of yarn are you using? Currently we only support 1.10.1. Make sure you have the correct version installed: npm i -g yarn@1.10.1. If you installed yarn through something else besides npm (homebrew for example), try uninstalling that package and using npm to install.
  • What OS are you using? There may be problems on Windows that I can't reproduce on my machine.

it looks like even running yarn from the packages dir it looking at the node_modules from the root repo as if I am missing some config to tell yarn / tsc to ignore thate dir

This is expected. We utilize the "workspaces" feature in yarn to share a single node_modules directory to avoid unnecessarily duplicating dependencies.

Yep it was a problem with my yarn.lock file. I deleted it due to the environment I building in. replaced it with the orginal one modifid the urls to point at our private mirror and it builds fine

thanks for your help

1 Like

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