当我在本地使用我的文件并发出http请求时,我开始使用node.js,并使用和node.js sdk,但是当我试图上传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))事先谢谢你,对你的英语不好很抱歉
发布于 2017-02-13 14:16:03
我代替了
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函数。
https://stackoverflow.com/questions/42199720
复制相似问题