エラーを解決できません。解決できません。 下の写真をご覧ください。
ありがとう!
デバッグからの情報を追加しました:
Cannot read property "Client" of undefined"
stack
:
"TypeError: Cannot read property "Client" of undefined↵ at eval (eval at <anonymous> (http://192.168.10.151:8000/scripts/main.js:7:36), <anonymous>:1:15)↵ at http://192.168.10.151:8000/scripts/main.js:7:36↵ at Object.execCb (http://192.168.10.151:8000/scripts/require.js:1650:33)↵ at Module.check (http://192.168.10.151:8000/scripts/require.js:866:51)↵ at Module.<anonymous> (http://192.168.10.151:8000/scripts/require.js:1113:34)↵ at http://192.168.10.151:8000/scripts/require.js:132:23↵ at http://192.168.10.151:8000/scripts/require.js:1156:21↵ at each (http://192.168.10.151:8000/scripts/require.js:57:31)↵ at Module.emit (http://192.168.10.151:8000/scripts/require.js:1155:17)↵ at Module.check (http://192.168.10.151:8000/scripts/require.js:917:30)
回答:
回答№1は1@SteveRが示唆したようにデバッガを操作した後、ついに私はelastiseach.jsと次のことへと導くヒントを見つけました。
// In order to help people who were accidentally upgraded to this ES client,
// throw an error when they try to instanciate the exported function.
// previous "elasticsearch" module -> https://github.com/ncb000gt/node-es
function es() {
throw new Error("Looks like you are expecting the previous "elasticsearch" module. "
+
"It is now the "es" module. To create a client with this module use" +
"`new es.Client(params)`.");
}
es.Client = __webpack_require__(1);
es.ConnectionPool = __webpack_require__(33);
es.Transport = __webpack_require__(2);
es.errors = __webpack_require__(17);
module.exports = es;
それに応じてコードを修正する:
define(["scripts/d3.v3", "scripts/elasticsearch"], function (d3, es) {
"use strict";
var client = new elasticsearch.Client({
host: "http://192.168.10.151:9200"
});
// your code
}