【问题标题】:meteor with mrt - iron:router: no such package带有mrt的流星-铁:路由器:没有这样的包
【发布时间】:2014-10-12 14:26:26
【问题描述】:

我正在学习 meteor 0.8.3 并尝试使用 iron-router 设置一些基本路由

我的smart.json 包含:

{
  packages: {
    iron-router: {
      git: https://github.com/EventedMind/iron-router.git,
      branch: blaze-integration
    }
  }
}

我添加了这个,然后运行 ​​mrt installmrt update

然后我这样做了,得到了这个错误:

$ meteor add iron:router
iron-router: updating npm dependencies -- connect...
iron:router: no such package

我仍然能够使用mrt 运行应用程序,并且应用程序启动,但我从 layout.js:92 获得Uncaught TypeError: Cannot read property 'extend' of undefined,页面上没有任何显示。

我的路由器块如下所示:

 Router.map( function() {
   this.route('home', { path: '/' });
   this.route('create');
   this.route('tasksShow', { 
     path: '/tasks/:_id',
     data: function() { return Tasks.findOne(this.params._id); }
   });
 });

我做错了什么,我怎样才能让 Iron-router 工作?

【问题讨论】:

  • 从 smart.json 中清除 iron-router 条目并再次安装:mrt add iron-router
  • 忘了把它放在问题正文中,但我确实执行了那个步骤 - 为了安全起见,我又试了一次。我做了mrt add iron-router && mrt install && mrt update && meteor add iron:router,但最终结果仍然是iron:router: no such package

标签: meteor meteorite iron-router


【解决方案1】:

IronRouter 的安装:

Meteor 0.8.3 及更早版本

$ mrt add iron-router

Meteor 0.9.0 及更新版本

$ meteor add iron:router

在此处了解有关此问题的更多信息:Installation issues with iron-router (newest) on Windows 7 x64 (Meteor 0.8.3)

【讨论】:

  • 我按照这里的说明进行操作:github.com/EventedMind/iron-router#installation -- 似乎特别建议使用mrt 添加包 使用meteor add 添加包。是我看错了,还是文档过时了?
  • 问题是使用meteor 0.8.3造成的,指令是为meteor 0.9.0准备的。迁移到流星 0.9.0 或尝试使用mrt add iron-router 安装。
猜你喜欢
  • 2014-03-02
  • 2014-06-20
  • 2014-09-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-13
  • 2015-08-11
  • 1970-01-01
相关资源
最近更新 更多