Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
node.js和express应用程序中未处理的错误事件_Node.js_Express_Passport.js - Fatal编程技术网

node.js和express应用程序中未处理的错误事件

node.js和express应用程序中未处理的错误事件,node.js,express,passport.js,Node.js,Express,Passport.js,我一直在关注关于“使用PassportJS进行身份验证”的教程 并从他的回购协议下载了文件。我把终端指示我的包裹装进去。然后我尝试再次运行该应用程序,但收到了此消息 connect.multipart() will be removed in connect 3.0 visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives connect.limit() will be removed in con

我一直在关注关于“使用PassportJS进行身份验证”的教程

并从他的回购协议下载了文件。我把终端指示我的包裹装进去。然后我尝试再次运行该应用程序,但收到了此消息

connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
Express server listening on port 3000

events.js:66
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: failed to connect to [localhost:27017]
    at Server.connect.connectionPool.on.server._serverState (/Users/juangallardo/Desktop/PassportJS-Authentication-master/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/server.js:540:74)
    at EventEmitter.emit (events.js:115:20)
    at connection.on._self._poolState (/Users/juangallardo/Desktop/PassportJS-Authentication-master/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:140:15)
    at EventEmitter.emit (events.js:91:17)
    at Socket.errorHandler (/Users/juangallardo/Desktop/PassportJS-Authentication-master/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/connection.js:478:10)
    at Socket.EventEmitter.emit (events.js:88:17)
    at Socket._destroy.self.errorEmitted (net.js:335:14)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)

问题是我没有运行MongoDB

我发现了那个“问题”

然后获得了安装和运行mongo的说明

然后,您只需使用以下命令从终端启动mongo服务器

mongod
然后回到你的项目中,用

node app.js
node app.js