当我尝试在 couchbase nodejs 服务器上运行简单的测试时,我收到“不正确的参数”错误
I get "Incorrect argument" error when i try to run a simple test on couchbase nodejs server
var couchbase = require("couchbase");
var cluster = new couchbase.Cluster('127.0.0.1:8091');
var bucket = cluster.openBucket('beer-sample', function(err) {
if (err) {
throw err;
}
bucket.get('aass_brewery-juleol', function(err, result) {
if (err) {
throw err;
}
var doc = result.value;
console.log(doc.name + ', ABV: ' + doc.abv);
doc.comment = "Random beer from Norway";
bucket.replace('aass_brewery-juleol', doc, function(err, result) {
if (err) {
throw err;
}
console.log(result);
process.exit(0);
});
});
});
这是我的文件。这是这里的例子:http://docs.couchbase.com/developer/node-2.0/hello-couchbase.html
因此,当我尝试使用"nodejs test1.js"运行服务器时,出现"参数不正确"错误。
在 bucket.js、module.js 和 cluster.js into node_modules/couchbase/lib/
我已经安装了couchbase,并且安装了完整的nodejs。我是新手,我不明白我的错误在哪里。也许与沙发基础的版本或我不知道的节点版本有关。
这是我进入终端的完整错误:
Error: Incorrect argument
at New Bucket (home/anton/node_modules/couchbase/lib/bucket.js:213:16)
at Object<anonymus> (home/anton/PhpstormProjects/couchbase/test1.js:6:22)
at Cluster.openBucket (home/anton/node_modules/couchbase/lib/cluster.js:37:10)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
用于连接到集群的"规范"格式是couchbase://host
在您的情况下主机localhost
。
根据您使用的版本,可能已添加较新的增强功能以允许常见host:8091
反模式,但仍不正确。
如果您升级到较新版本,您的代码可能仍然可以工作 - 但您仍应使用 couchbase://
变体(不带端口)。
相关文章:
- Jquery菜单操作不稳定,定位不正确,存在一般错误
- 更改错误文本“用户 ID 或密码不正确”
- 使用 WebAPI 和 IE8/9 上传剑道文件不正确的错误消息
- 错误:'这'对象不正确;在JQuery中单击事件-单击时的意外行为
- 网页加载不正确:'"JSON”;未定义'错误
- 解码URI抛出错误“URI格式不正确”
- 当我尝试在 couchbase nodejs 服务器上运行简单的测试时,我收到“不正确的参数”错误
- XML 解析错误:使用浏览器内置解析器解析 XML 字符串时格式不正确
- 为什么我会收到“格式不正确”错误
- 使用 jquery 访问 JSON 时格式不正确的错误
- Javascript/JSON 错误:格式不正确
- 使用AngularJS循环访问JSON文件时出现“格式不正确”的Firefox错误
- JSON格式不正确错误
- xpi中第一行出现格式不正确的错误
- Dojo表单.如何显示关于不正确填写的表单元素的错误,如dijit方法validate()所做的
- 如果JSON不正确,如何验证JSON字符串并返回错误
- Javascript中存在不正确的操作错误
- 当用户键入不正确的输入值时,返回错误消息
- 插件Jquery Validation的错误消息显示不正确
- "XML解析错误:格式不正确“;在斐波那契数生成中