问题描述
我正在学习meteor 0.8.3
,并尝试使用 iron-router 进行一些基本的路由设置
I'm learning meteor 0.8.3
and trying to get some basic routing set up using iron-router
我的smart.json
包含:
{
packages: {
iron-router: {
git: https://github.com/EventedMind/iron-router.git,
branch: blaze-integration
}
}
}
我添加了它,然后运行了mrt install
和mrt update
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
我仍然可以使用mrt
运行该应用程序,并且该应用程序启动,但是我从layout.js:92获得Uncaught TypeError: Cannot read property 'extend' of undefined
,页面上没有任何显示.
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.
我的路由器块如下:
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?
推荐答案
IronRouter的安装:
Installation of IronRouter :
$ mrt add iron-router
$ meteor add iron:router
有关此问题的更多信息,请参见:
More about this issue here: Installation issues with iron-router (newest) on Windows 7 x64 (Meteor 0.8.3)
这篇关于带有MRT的流星-Iron:Router:没有这样的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!