Usergrid node.js usergrid.init() 错误
Usergrid node.js usergrid.init() error
我开始使用 apigee 并使用 baas withe usergrid 和 node.js sdk 当我在本地使用我的文件并发出 http 请求时没有问题但是当我尝试上传 node.js 文件:
apigeetool deployproxy -u USERNAME -p PASSWORD -o ORG -e test -n hello -d .
并尝试发出请求我得到了错误
{"fault":{"faultstring":"Script node executed prematurely: TypeError: Cannot find function setPrototypeOf in object function Object() { [native code for Object.Object, arity=1] }\n.\nTypeError: Cannot find function setPrototypeOf in object function Object() { [native code for Object.Object, arity=1] }\n.\n at \/organization\/environment\/api\/node_modules\/usergrid\/usergrid.js:29\n at \/organization\/environment\/api\/app.js:28\n at module.js:456\n at module.js:474\n at module.js:356\n at module.js:312\n at module.js:497\n at startup (trireme.js:142)\n at trireme.js:923\n","detail":{"errorcode":"scripts.node.runtime.ScriptExitedError"}}}
它似乎来自我的 app.js 文件,行:
usergrid.init();
更准确地说,来自我的 usergrid.js 文件,行
Object.setPrototypeOf(self, new UsergridClient(options))
提前谢谢你,抱歉英语不好
我替换了
usergrid.init();
来自
var UsergridClient = require('./node_modules/usergrid/lib/client')
var Usergrid = new UsergridClient
({
"appId": "<my_appId>",
"orgId": "<my_orgId>",
"authMode": "<my_authMode>",
"baseUrl": "<my_baseUrl>",
"clientId": "<my_clientId>",
"clientSecret": "<my_clientSecret>"
})
这样 usergrid.js 不会执行,也不会调用 setPrototypeOf 函数
我开始使用 apigee 并使用 baas withe usergrid 和 node.js sdk 当我在本地使用我的文件并发出 http 请求时没有问题但是当我尝试上传 node.js 文件:
apigeetool deployproxy -u USERNAME -p PASSWORD -o ORG -e test -n hello -d .
并尝试发出请求我得到了错误
{"fault":{"faultstring":"Script node executed prematurely: TypeError: Cannot find function setPrototypeOf in object function Object() { [native code for Object.Object, arity=1] }\n.\nTypeError: Cannot find function setPrototypeOf in object function Object() { [native code for Object.Object, arity=1] }\n.\n at \/organization\/environment\/api\/node_modules\/usergrid\/usergrid.js:29\n at \/organization\/environment\/api\/app.js:28\n at module.js:456\n at module.js:474\n at module.js:356\n at module.js:312\n at module.js:497\n at startup (trireme.js:142)\n at trireme.js:923\n","detail":{"errorcode":"scripts.node.runtime.ScriptExitedError"}}}
它似乎来自我的 app.js 文件,行:
usergrid.init();
更准确地说,来自我的 usergrid.js 文件,行
Object.setPrototypeOf(self, new UsergridClient(options))
提前谢谢你,抱歉英语不好
我替换了
usergrid.init();
来自
var UsergridClient = require('./node_modules/usergrid/lib/client')
var Usergrid = new UsergridClient
({
"appId": "<my_appId>",
"orgId": "<my_orgId>",
"authMode": "<my_authMode>",
"baseUrl": "<my_baseUrl>",
"clientId": "<my_clientId>",
"clientSecret": "<my_clientSecret>"
})
这样 usergrid.js 不会执行,也不会调用 setPrototypeOf 函数