2

我正在使用节点后端并尝试连接到格子。我的代码:

var plaid = require('plaid');

var clientID = "bla";
var secretID = "bla";
var publicKey = "bla";

var client = new plaid.Client(
    clientID,
    secretID,
    publicKey,
    plaid.environments.sandbox

);

但是我在控制台中收到此错误:

    throw new Error('Invalid Plaid environment');
    ^

Error: Invalid Plaid environment
    at new Plaid.Client (C:\Users\me\Documents\found\SPA\node_modules\plaid\index.js:26:11)
    at module.exports (C:\Users\me\Documents\found\SPA\app\routes.js:48:22)
    at Object.<anonymous> (C:\Users\me\Documents\found\SPA\server.js:48:24)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)

我试过使用这些都没有运气:

plaid.environments.sandbox
plaid.environments.development 
plaid.environments.tartan

这是怎么回事?

参考:https ://plaid.com/docs/quickstart/#accessing-item-data

更新:我得到了下面的代码,可以在我的应用程序的另一部分工作:

var plaidClient = new plaid.Client(clientID, secretID, plaid.environments.tartan);

但是我正在尝试使用client.getTransactions(),并且需要它var plaidClient = new plaid.Client(clientID, secretID, publicID, plaid.environments.sandbox); 才能client.getTransactions()工作。

更新?

4

1 回答 1

0

出于某种原因,我安装了错误版本的格子。我需要卸载并重新安装才能修复。现在工作。

于 2017-03-29T17:21:37.790 回答