Missing "use strict" statement
即使它贴在文件顶部,我也会得到这个,这让我感到困惑。对于第 10 行和第 12 行,此错误出现两次。
'user strict';
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
host : 'http://localhost:9200'
});
client.search({
index: 'twitter',
type: 'tweets'
}).then(function (resp) {
var hits = resp.hits.hits;
}, function (err) {
console.trace(err.message);
});