正确的方法来指定Meteor包依赖项

时间:2014-05-17 16:53:45

标签: javascript meteor package

我正在尝试创建一个依赖于另一个流星包的新Meteor包。当我尝试meteor add mypackage时,我收到以下错误。为什么Meteor不添加mypackage并引入它的依赖?

=> Errors while scanning packages:

While building package 'mypackage':
error: no such package: 'aloha-editor'

以下是mypackage中的package.js和smart.json文件。

package.js

Package.describe({
  summary: "REPLACEME - What does this package (or the original one you're wrapping) do?"
});

Package.on_use(function (api, where) {
  api.add_files('package1.js', ['client', 'server']);
});

Package.on_test(function (api) {
  api.use('aloha-editor', 'client');
  api.use('package1', 'client');

  api.add_files('package1_tests.js', 'client');
});

smart.json

{
  "name": "package1",
  "description": "REPLACEME - What does this package (or the original one you're wrapping) do?",
  "homepage": "",
  "author": "Your Name <your@email> (http://yoursite)",
  "version": "0.0.1",
  "git": "",
  "packages": {
    "aloha-editor": {}
  }
}

1 个答案:

答案 0 :(得分:1)

您的依赖关系似乎已正确定义。但是,您需要运行mrt add mypackage而不是meteor add mypackage。第二个命令仅使用Meteor提供的包,而mrt可以访问您尝试使用的整个Atmosphere存储库。