私はNode.jsにかなり慣れていないので、DrupalChat(v7dev)モジュールを試すためにNode.jsをインストールします。チャットモジュールの設定が読み込まれる段階を超えているため、この問題はnode.jsまたはexpressのいずれかにあると思います。チャットサーバーを起動しようとすると、次の出力に直面します
Extension loaded: drupalchat_nodejs.server.extension.js
Started http server.
info - socket.io started
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot read property 'url' of undefined
at Function.handle (/usr/local/lib/node_modules/npm/node_modules/express/node_modules/connect/lib/proto.js:105:18)
at Server.app (/usr/local/lib/node_modules/npm/node_modules/express/node_modules/connect/lib/connect.js:60:31)
at Server.serverListening (/usr/local/lib/node_modules/npm/node_modules/socket.io/node_modules/policyfile/lib/server.js:136:16)
at Server.g (events.js:154:14)
at Server.emit (events.js:64:17)
at Array.1 (net.js:710:10)
at EventEmitter._tickCallback (node.js:192:40)
Expressをインストールすると、「.... bugs['web']はおそらくbugs['url']」のような警告が表示されたのを覚えています(プレフィックスを思い出せません)
それで、サーバーが(API?)変数「url」を読み取ろうとしているのに、現在は「web」を読み取ろうとしているのでしょうか。
すべてのモジュールを最新の状態にしていますが、ダウングレードする必要がありますか?または、別のモジュールを使用してこれを回避する方法はありますか?
編集:201行目は最後の行です(authenticatedClients [authData.authToken];)を削除します...適切なコンテキストのために関数全体に追加しました
var authenticateClientCallback = function (error, response, body) {
if (error) {
console.log("Error with authenticate client request:", error);
return;
}
if (response.statusCode == 404) {
if (settings.debug) {
console.log('Backend authentication url not found, full response info:', response);
}
else {
console.log('Backend authentication url not found.');
}
return;
}
var authData = false;
try {
authData = JSON.parse(body);
}
catch (exception) {
console.log('Failed to parse authentication message:', exception);
if (settings.debug) {
console.log('Failed message string: ' + body);
}
return;
}
if (!checkServiceKey(authData.serviceKey)) {
console.log('Invalid service key "', authData.serviceKey, '"');
return;
}
if (authData.nodejsValidAuthToken) {
if (settings.debug) {
console.log('Valid login for uid "', authData.uid, '"');
}
setupClientConnection(authData.clientId, authData, authData.contentTokens);
authenticatedClients[authData.authToken] = authData;
}
else {
console.log('Invalid login for uid "', authData.uid, '"');
delete authenticatedClients[authData.authToken];
}
}