我对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