2017-02-13 7 views
3

私はapigeeを使い始めます。私は自分のファイルをローカルで使用し、httpリクエストを行うときに問題はありませんが、試してみるとbaas withe usergridとnode.js sdkを使用しますNode.jsのファイルをアップロードしますUsergrid node.js usergrid.init()エラー

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)) 

は、事前にあなたに感謝し、悪い英語

答えて

0

のため申し訳ありません私は

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.init(); 

を置き換えます

このようにして、usergrid.jsは実行されず、setPrototy peOf関数