我使用nodester與iriscouch。我已經安裝了couchdb-api包。這是我的代碼:讓CouchDB與node.js一起工作
console.log("Running");
//Appears in the logs
var dbServer = require("couchdb-api").srv('eric-wieser.iriscouch.com');
console.log(dbServer);
//Appears in the logs
dbServer.info(function (err, response) {
console.log("Info!");
//Never executed. Logs show:
//Error: ECONNREFUSED, Could not contact DNS servers
// at IOWatcher.callback (dns.js:74:15)
});
爲什麼這不起作用?試圖告訴我什麼是錯誤?
Linux或Windows? – stewe
在節點上運行。所以我假設Linux,因爲他們的cli是linux的。但我其實不知道。 – Eric
似乎DNS服務器有問題。我會在'/ etc/resolv.conf'中加入'nameserver 8.8.8.8',但是我懷疑你可以在nodeter上更改:( – stewe