git clone https://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head/
執(zhí)行 npm install 報(bào)錯(cuò):
執(zhí)行?npm install phantomjs-prebuilt@2.1.16 --ignore-scripts 命令
–ignore-scripts參數(shù)用于npm install在安裝插件時(shí)忽略package.json中設(shè)置的腳本,意思就是避免package.json中的腳本影響插件的正常安裝
安裝成功!?
執(zhí)行 npm start 啟動(dòng)
訪問(wèn):http://localhost:9100/
此時(shí)顯示elasticsearch未連接,需要修改一下elasticsearch的配置并重新啟動(dòng)
修改elasticsearch.yml文件,新增如下配置:
# 跨域
http.cors.enabled: true
http.cors.allow-origin: "*"
打開(kāi)head/Gruntfile.js文件,修改服務(wù)器監(jiān)聽(tīng)地址,增加hostname屬性,將其值設(shè)置為*
如果你修改過(guò)elasticsearch的ip和端口,需要重新配置head/_site/app.js文件下連接elasticsearch的地址
將圖中地址改為你的elasticsearch地址即可!
?
重啟elasticsearch和elasticsearch-head,再次訪問(wèn):
http://localhost:9100/
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-538085.html
?elasticsearch連接成功!文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-538085.html
到了這里,關(guān)于安裝 elasticsearch-head 環(huán)境時(shí)報(bào)錯(cuò):Failed at the phantomjs-prebuilt@2.1.16 install script.的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!