由于项目需要定制开发kibana,因此需要编译kibana,在开发环境下运行。
注意:必须下载kibana 5.5的源码才能正常编译,下载release或者snapshot版本是不行的,运行npm start会因为无scripts目录报错。
Setting Up kibana Development Environment
Fork, then clone the kibana
repo and change directory into it
下载kibana5.5源码解压后 cd kibana记得还要 git 初始化下,因为build时候依赖.git目录。
Install the version of node.js listed in the .node-version
file (this can be easily automated with tools such as nvm and avn)
nvm install "$(cat .node-version)"注:没有的话就自己生成一个.node-version,写入6.11.1
Install npm
dependencies
npm install注意:npm --registry https://registry.npm.taobao.org install 用国内源加速
Start elasticsearch. 启动es,然后
npm start
当改动src目录后, 它会主动监测改动,重新启动web服务。然后访问localhost:5601就可以看到效果了。
补充:
npm run build就可以编译打包,发布的话,貌似是npm run release。具体可以看package.json里的scripts:
"scripts": { "test": "grunt test", "test:dev": "grunt test:dev", "test:quick": "grunt test:quick", "test:browser": "grunt test:browser", "test:ui": "grunt test:ui", "test:ui:server": "grunt test:ui:server", "test:ui:runner": "echo ‘use `node scripts/functional_test_runner`‘ && false", "test:server": "grunt test:server", "test:coverage": "grunt test:coverage", "test:visualRegression": "grunt test:visualRegression:buildGallery", "checkLicenses": "grunt licenses", "build": "grunt build", "release": "grunt release", "start": "sh ./bin/kibana --dev", "precommit": "grunt precommit", "karma": "karma start", "elasticsearch": "grunt esvm:dev:keepalive", "lint": "grunt eslint:source", "lintroller": "grunt eslint:fixSource", "makelogs": "echo ‘use `node scripts/makelogs`‘ && false", "mocha": "echo ‘use `node scripts/mocha`‘ && false", "sterilize": "grunt sterilize", "uiFramework:start": "grunt uiFramework:start", "uiFramework:build": "grunt uiFramework:build" },
时间: 2024-10-30 02:49:19