I m new to node, I follow the official Guide on the README file, 我认为,mongodb-rest已经成功安装,但pm显示:
npm ls
/usr/local/bin
(empty)
这里所列的没有定额备用金
I simply don t know how to fire up the server as the guide says
After that you can just issue mongodb-rest on the command line and the server should start.
I try node mongodb-rest
or even type mongodb-rest
in the node console, but either one works.
Help!
Update--
由于有人回答我的问题,我认为我成功地通过 n安装了“mongodb-rest”一揽子备用金,并按“mongodb-rest<>/code”类型启用了“mongodb-rest
,并在另一个窗口使用“ cur”作为README书写器,提出“要求”。
curl -d { "A1" : 201 } -H "Content-Type: application/json" http://localhost:3000/test/example1
页: 1
以及服务器中的信息:
node.js:134
throw e; // process.nextTick error, or error event on first tick
^
TypeError: Cannot call method authenticate of null
at /usr/local/lib/node_modules/mongodb-rest/lib/rest.js:72:10
at /usr/local/lib/node_modules/mongodb-rest/node_modules/mongodb/lib/mongodb/db.js:176:16
at [object Object].<anonymous> (/usr/local/lib/node_modules/mongodb-rest/node_modules/mongodb/lib/mongodb/connection/server.js:366:7)
at [object Object].emit (events.js:81:20)
at [object Object].<anonymous> (/usr/local/lib/node_modules/mongodb-rest/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:97:15)
at [object Object].emit (events.js:67:17)
at Socket.<anonymous> (/usr/local/lib/node_modules/mongodb-rest/node_modules/mongodb/lib/mongodb/connection/connection.js:399:12)
at Socket.emit (events.js:64:17)
at Array.<anonymous> (net.js:831:12)
at EventEmitter._tickCallback (node.js:126:26)