Warning: Task "server" not found. Use --force to continue.

再ES5.0以上的版本中,安装head插件比较麻烦,中途遇到这个报错:

C:\ELK\elasticsearch-5.6.2\head>grunt server
Loading "Gruntfile.js" tasks...ERROR
>> SyntaxError: Invalid or unexpected token
Warning: Task "server" not found. Use --force to continue.
Aborted due to warnings.

因为对Gruntfile.js文件进行过修改,修改内容如下:

connect: {
        server: {
                options: {
                        hostname: '*',
                        port: 9100,
                        base: '.',
                        keepalive: true
                }
        }
}

hostname: ‘*’,是新加的,故去查看它是否出问题,结果发现果然有错误,port前丢了逗号,解决后重新启动,正常。y也要注意中英文符号,

你可能感兴趣的:(ES)