作爲NodeJS初學者,我發現了關於此框架的新內容,非常有趣。Firebase:發生未知的服務器錯誤
所以我試圖寫它與火力數據庫通信的腳本的NodeJS,但這個錯誤被逮住
你有關於這個漏洞的任何想法嗎?
authLinkedIn>node bin\www
Listening on port 3000
[Simple Login] Login Failed! { Error: An unknown server error occurred.
at Error (native)
at T (authLinkedIn\node_modules\firebase\lib\firebase-node.js:135:1256)
at ClientRequest.<anonymous> (authLinkedIn\node_modules\firebase\lib\firebase-node.js:140:308)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:308:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at emitErrorNT (net.js:1271:8)
at _combinedTickCallback (internal/process/next_tick.js:74:11) code: 'SERVER
_ERROR' }
Simple login authentification won't work
這裏是 「www」 的文件來源:
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
//var debug = require('debug')('_example:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
//debug('Listening on ' + bind);
console.log('Listening on ' + bind);
}
這幾乎是默認的Express服務器。您的錯誤發生在應用程序某處的回調中。發佈您的'app.js'和其他應用程序代碼。 – svens