[英]Meteor “cannot find module 'braintree'”
我正在尝试将Braintree付款与我的网站集成,但是Meteor不断出现以下错误:
Error: Cannot find module 'Braintree'
我使用meteor add ulexus:braintree
和meteor add hiukim:braintree-helper
meteor add ulexus:braintree
到了项目中。
我跟随着这个尝试来使我的项目正常工作。 这是我的代码:
// inside Meteor.startup
Braintree = Npm.require('braintree');
var config = Braintree.connect({
environment: Braintree.Environment.Sandbox,
merchantId: "my merchant id",
privateKey: "my private key",
publicKey: "my public key"
});
BraintreeHelper.getInstance().connect(config);
我也尝试过使用sudo npm install braintree
安装Braintree,但这也不起作用。 如果我在没有Braintree = ...
情况下尝试尝试, cannot call method baseUrl on undefined
出现错误cannot call method baseUrl on undefined
。
我真的很感谢您的帮助。 注意:我以前从未使用过Braintree,直到最近才开始使用Meteor。
谢谢!
只需添加braintree与
npm install braintree
并与
var braintree = require("braintree");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.