Build Kibana in Windows 7 (git-bash)


(Rahul Singhai) #1

Hi, I am trying to build the Kibana for plug-in development on my Windows machine, but unable to do so.
I followed the steps mentioned in CONTRIBUTING.md file in respective branches.

Details are:
OS: Windows 10
Shell: git-bash
Kibana version: tags/v6.3.1, tags/v5.6.10 and tags/v5.6.3

Errors:

  1. While building Kibana 6.3.1 using yarn, I get babel command not found error:

    /c/work/github/kibana [(HEAD detached at v6.3.1)] $ yarn kbn bootstrap --verbose
    yarn run v1.8.0
    $ node scripts/kbn bootstrap --verbose
    Running [bootstrap] command from [C:\work\github\kibana]:
    
    Found [17] projects:
    
    kibana
    ├── packages
    │   ├── eslint-config-kibana (@elastic/eslint-config-kibana)
    │   ├── eslint-plugin-kibana-custom (@elastic/eslint-plugin-kibana-custom)
    │   ├── kbn-babel-preset (@kbn/babel-preset)
    │   ├── kbn-datemath (@kbn/datemath)
    │   ├── kbn-dev-utils (@kbn/dev-utils)
    │   ├── kbn-es (@kbn/es)
    │   ├── kbn-eslint-import-resolver-kibana (@kbn/eslint-import-resolver-kibana)
    │   ├── kbn-eslint-plugin-license-header (@kbn/eslint-plugin-license-header)
    │   ├── kbn-plugin-generator (@kbn/plugin-generator)
    │   ├── kbn-plugin-helpers (@kbn/plugin-helpers)
    │   ├── kbn-pm (@kbn/pm)
    │   ├── kbn-system-loader (@kbn/system-loader)
    │   ├── kbn-test-subj-selector (@kbn/test-subj-selector)
    │   ├── kbn-test (@kbn/test)
    │   └── kbn-ui-framework (@kbn/ui-framework)
    └── x-pack
    
    ...skipping logs due to character limit here...
    
    Installing dependencies in [@kbn/test]:
    
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    info fsevents@1.2.3: The platform "win32" is incompatible with this module.
    info "fsevents@1.2.3" is an optional dependency and failed compatibility check. Excluding it from installation.
    [3/4] Linking dependencies...
    
    
    Installing dependencies in [x-pack]:
    
    $ node ../preinstall_check
    [1/5] Validating package.json...
    [2/5] Resolving packages...
    [3/5] Fetching packages...
    info fsevents@1.1.3: The platform "win32" is incompatible with this module.
    info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
    [4/5] Linking dependencies...
    warning "@elastic/eui > eslint-config-prettier@2.9.0" has unmet peer dependency "eslint@>=3.14.1".
    warning " > ngreact@0.5.1" has unmet peer dependency "angular@< 2.0.0".
    warning " > react-router-breadcrumbs-hoc@1.1.2" has unmet peer dependency "react-router@^4.2.0".
    warning " > react-sticky@6.0.1" has incorrect peer dependency "react@^15.3.0".
    warning " > react-sticky@6.0.1" has incorrect peer dependency "react-dom@^15.3.0".
    
    
    Installing dependencies in [kibana]:
    
    $ node ./preinstall_check
    [1/5] Validating package.json...
    [2/5] Resolving packages...
    [3/5] Fetching packages...
    info fsevents@1.1.3: The platform "win32" is incompatible with this module.
    info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
    [4/5] Linking dependencies...
    warning "x-pack > react-router-breadcrumbs-hoc@1.1.2" has unmet peer dependency "react-router@^4.2.0".
    warning "x-pack > react-sticky@6.0.1" has incorrect peer dependency "react@^15.3.0".
    warning "x-pack > react-sticky@6.0.1" has incorrect peer dependency "react-dom@^15.3.0".
    
    Installs completed, linking package executables:
    
    [x-pack] plugin-helpers -> ../packages/kbn-plugin-helpers/bin/plugin-helpers.js
    
    Linking executables completed, running `kbn:bootstrap` scripts
    
    @kbn/datemath: $ yarn build
    @kbn/system-loader: $ yarn build
    @kbn/datemath: $ babel src --out-dir target
    @kbn/system-loader: $ tsc
    × @kbn/datemath: 'babel' is not recognized as an internal or external command,
    × @kbn/datemath: operable program or batch file.
    @kbn/datemath: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    × @kbn/datemath: error Command failed with exit code 1.
    @kbn/datemath: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    × @kbn/datemath: error Command failed with exit code 1.
    
    [bootstrap] failed:
    
    Error: Command failed: yarn run kbn:bootstrap
    'babel' is not recognized as an internal or external command,
    operable program or batch file.
    error Command failed with exit code 1.
    error Command failed with exit code 1.
    
    $ yarn build
    $ babel src --out-dir target
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    
        at makeError (C:\work\github\kibana\packages\kbn-pm\dist\index.js:39003:9)
        at Promise.all.then.arr (C:\work\github\kibana\packages\kbn-pm\dist\index.js:39108:16)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:188:7)
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    
  2. After building v5.6.3 or v5.6.10 (which succeeds), I get Cannot read property '5.x' of undefined error:

    /c/work/github/kibana [(HEAD detached at v5.6.3)] $ npm run elasticsearch
    
    > kibana@5.6.3 elasticsearch C:\work\github\kibana
    > grunt esvm:dev:keepalive
    
    Running "esvm:dev:keepalive" (esvm) task
    starting up "dev" cluster
    Keeping elasticsearch alive, to shutdown press command/control+c
    Fatal error: Cannot read property '5.x' of undefined
    
    npm ERR! Windows_NT 6.1.7601
    npm ERR! argv "C:\\work\\software\\nodejs\\node.exe" "C:\\work\\software\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "elasticsearch"
    npm ERR! node v6.11.1
    npm ERR! npm  v3.10.10
    npm ERR! code ELIFECYCLE
    npm ERR! kibana@5.6.3 elasticsearch: `grunt esvm:dev:keepalive`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the kibana@5.6.3 elasticsearch script 'grunt esvm:dev:keepalive'.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the kibana package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     grunt esvm:dev:keepalive
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs kibana
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!     npm owner ls kibana
    npm ERR! There is likely additional logging output above.
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\work\github\kibana\npm-debug.log
    

(Jen Huang) #2

Can you confirm that you have the right node, yarn/npm installed for the appropriate versions?

v6.3.1 needs node 8.11.3 and yarn >= 1.6.0.

v5.6.10 needs node 6.14.0 and npm 3.10.10.

v5.6.3 needs node 6.11.1 and npm 3.10.10.


(Rahul Singhai) #3

Yes, I installed nvm and managing node and yarn+npm versions using it, as suggested by CONTRIBUTING.md page.
For v6.3.1, node is 8.11.3 and yarn is 1.8.0
For v5.6.10, node is 6.14.0 and npm is 3.10.10
For v5.6.3, node is 6.11.1 and npm is again 3.10.10


(system) #4

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