简体   繁体   中英

Correct way to specify Meteor package dependencies

I am trying to create a new Meteor package that depends on another meteor package. When I try meteor add mypackage I get the following error. Why isn't Meteor adding mypackage and pulling in it's dependencies?

=> Errors while scanning packages:

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

Here are the package.js and smart.json files from mypackage.

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": {}
  }
}

Your dependency seems to be defined correctly. However, you need to run mrt add mypackage instead of meteor add mypackage . The second command only uses packages provided with Meteor, while mrt has access to the whole Atmosphere repository you're trying to use.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM