4

I'm learning meteor 0.8.3 and trying to get some basic routing set up using iron-router

My smart.json contains:

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

I added this, and then ran mrt install and mrt update

Then I did this, and got this error:

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

I'm still able to run the application with mrt, and the application starts, but I get Uncaught TypeError: Cannot read property 'extend' of undefined from layout.js:92 and nothing shows up on the page.

My Router block looks like this:

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

What am I doing wrong, how can I get iron-router working?

asfallows
  • 5,998
  • 6
  • 29
  • 48
  • Clear iron-router entry from smart.json and install again using: `mrt add iron-router` – Kuba Wyrobek Aug 19 '14 at 13:08
  • Forgot to put that in the question body, but I did perform that step - and, to be safe, I tried again. I did `mrt add iron-router && mrt install && mrt update && meteor add iron:router` and still got `iron:router: no such package` as a final result. – asfallows Aug 19 '14 at 13:12
  • possible duplicate of [Meteor update to 0.8.3 breaks app](http://stackoverflow.com/questions/25383794/meteor-update-to-0-8-3-breaks-app) – Adam Monsen Aug 19 '14 at 18:00

1 Answers1

10

Installation of IronRouter :

Meteor 0.8.3 and older

$ mrt add iron-router

Meteor 0.9.0 and newer

$ meteor add iron:router

More about this issue here: Installation issues with iron-router (newest) on Windows 7 x64 (Meteor 0.8.3)

Community
  • 1
  • 1
Kuba Wyrobek
  • 5,273
  • 1
  • 24
  • 26
  • 1
    I followed the instructions here: https://github.com/EventedMind/iron-router#installation -- it seems to specifically suggest that one should add the package with `mrt` **and** add the package with `meteor add`. Did I misread that, or is the documentation out of date? – asfallows Aug 19 '14 at 13:19
  • The problem is caused by using meteor 0.8.3 and the instruction is prepared for meteor 0.9.0. Migrate to meteor 0.9.0 or try to install using `mrt add iron-router`. – Kuba Wyrobek Aug 19 '14 at 13:20