我對Node.js相當陌生,安裝它來試用DrupalChat(v7dev)模塊。我相信這個問題與node.js或express相關,因爲我超出了聊天模塊設置加載的階段。我試圖啓動聊天服務器node.js + express error:無法讀取undefined的屬性'url'
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)
我記得快遞安裝的時候,它給了像」警告....錯誤[‘網絡’]也許應該是bug ['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];
}
}
,你能否告訴Node.js的:201或者更多一點。 – malletjo 2012-04-16 15:12:21
我添加了它,現在我想知道它是否在開發人員可能要求的DrupalChat配置中的非必需設置(serviceKey),但沒有反映在他的代碼/註釋 – 2012-04-16 15:38:32
v7中並不穩定,您可能會發現這裏的東西:http://drupal.org/project/issues/drupalchat?status=All&categories=全部 – malletjo 2012-04-16 15:46:02