扔掉//未处理的'错误'事件错误:听EADDRNOTAVAIL

时间:2014-07-10 16:21:58

标签: javascript node.js mongodb web

我试图在本地运行node.js应用

我按

安装了所有依赖项
npm install 

我在一个单独的控制台选项卡中运行mongodb,显示类似

的内容
[~/apps/Mi aguila]$ sudo mongod                                                                                                                        rvm:ruby-2.1.1 
mongod --help for help and startup options
2014-07-10T10:40:16.096-0500 [initandlisten] MongoDB starting : pid=7067 port=27017 dbpath=/data/db 64-bit host=localhost
2014-07-10T10:40:16.097-0500 [initandlisten] 
2014-07-10T10:40:16.097-0500 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2014-07-10T10:40:16.097-0500 [initandlisten] db version v2.6.3
2014-07-10T10:40:16.097-0500 [initandlisten] git version: nogitversion
2014-07-10T10:40:16.097-0500 [initandlisten] build info: Darwin minimavericks.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.    13~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2014-07-10T10:40:16.097-0500 [initandlisten] allocator: tcmalloc
2014-07-10T10:40:16.097-0500 [initandlisten] options: {}
2014-07-10T10:40:16.099-0500 [initandlisten] journal dir=/data/db/journal
2014-07-10T10:40:16.100-0500 [initandlisten] recover : no journal files present, no recovery needed
2014-07-10T10:40:16.133-0500 [FileAllocator] allocating new datafile /data/db/local.ns, filling with zeroes...
2014-07-10T10:40:16.133-0500 [FileAllocator] creating directory /data/db/_tmp
2014-07-10T10:40:16.203-0500 [FileAllocator] done allocating datafile /data/db/local.ns, size: 16MB,  took 0.068 secs
2014-07-10T10:40:16.271-0500 [FileAllocator] allocating new datafile /data/db/local.0, filling with zeroes...
2014-07-10T10:40:16.383-0500 [FileAllocator] done allocating datafile /data/db/local.0, size: 64MB,  took 0.111 secs
2014-07-10T10:40:16.449-0500 [initandlisten] build index on: local.startup_log properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "local.startup_log" }
2014-07-10T10:40:16.455-0500 [initandlisten]     added index to empty collection
2014-07-10T10:40:16.458-0500 [initandlisten] command local.$cmd command: create { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0     numYields:0  reslen:37 323ms
2014-07-10T10:40:16.466-0500 [initandlisten] waiting for connections on port 27017
2014-07-10T10:41:16.144-0500 [clientcursormon] mem (MB) res:9 virt:2635
2014-07-10T10:41:16.144-0500 [clientcursormon]  mapped (incl journal view):160
2014-07-10T10:41:16.144-0500 [clientcursormon]  connections:0
2014-07-10T10:46:16.240-0500 [clientcursormon] mem (MB) res:5 virt:2635
2014-07-10T10:46:16.240-0500 [clientcursormon]  mapped (incl journal view):160
2014-07-10T10:46:16.240-0500 [clientcursormon]  connections:0

并且

当我通过

运行应用程序时
node app.js 

而且,我收到此错误

rvm:ruby-2.1.1 
Config : dev

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRNOTAVAIL
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1023:19)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at dns.js:72:18
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:906:3

0 个答案:

没有答案