私はREADME fileの公式ガイドに従って、ノードに新しいよ、私はMongoDBの休止が正常にインストールされていると信じて、しかし、NPMは示していますmongodb-restを実行するには?
npm ls
/usr/local/bin
(empty)
ここ
記載されているいかなるMongoDBは、残りの部分はありませんガイドは
After that you can just issue mongodb-rest on the command line and the server should start.
を言うように私は単に私がnode mongodb-rest
を試したり、ノードコンソールでmongodb-rest
を入力しますが、どちらか一方が動作するサーバーを起動する方法がわかりません。 ヘルプ!
Update--
人々のおかげで私の質問に答える、私は私が正常にNPM経由のMongoDB-残りのパッケージをインストールして考えると、タイプmongodb-rest
でのMongoDB-残りのサーバーを起動して、中のHTTP要求を行いますREADMEとしてカールを使用して、別のターミナルウィンドウが私が得た
curl -d '{ "A1" : 201 }' -H "Content-Type: application/json" http://localhost:3000/test/example1
書き込みcurl: (52) Empty reply from server
とサーバのコンソールにメッセージ:
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)
私は同じ問題を抱えています。 – dsummersl