Meteor Atmosphere/Core Package依赖解析覆盖(jquery,iron router,blaz



我有一个带以下包的流星应用程序:

$ meteor list
accounts-password      1.5.3  Password support for accounts
accounts-ui            1.3.1  Simple templates to add login widget...     
blaze-html-templates   1.1.2  Compile HTML templates into reactive...     
ecmascript             0.14.2  Compiler plugin that supports ES201...     
es5-shim               4.8.0  Shims and polyfills to improve ECMAS...     
fourseven:scss         4.12.0  Style with attitude. Sass and SCSS ...     
iron:router            1.1.2  Routing specifically designed for Me...     
jquery                 1.11.11* Manipulate the DOM using CSS selec...     
meteor-base            1.4.0  Packages that every Meteor app needs        
mobile-experience      1.0.5  Packages for a great mobile user exp...     
mongo                  1.8.1  Adaptor for using MongoDB and Minimo...     
reactive-var           1.0.11  Reactive variable
shell-server           0.4.0  Server-side component of the `meteor...     
standard-minifier-css  1.6.0  Standard css minifier used with Mete...     
standard-minifier-js   2.6.0  Standard javascript minifiers used w...     
tracker                1.2.0  Dependency tracker to allow reactive...     
typescript             3.7.5  Compiler plugin that compiles TypeSc...     

* New versions of these packages are available! Run 'meteor update'       
to try to update those packages to their latest versions. If your       
packages cannot be updated further, try typing
`meteor add <package>@<newVersion>` to see more information.

大气包jquery可与版本3.0.0一起使用。在安装iron-router之前,我一直都是这样。我按照以下建议成功安装了iron-router:https://forums.meteor.com/t/iron-router-jquery-dependency/51374(特别是meteor add iron:router --allow-incompatible-update(。

我想使用较新的3.0.0。我不认为iron-router内部有任何真正的不兼容。

然而,如果我尝试添加它,我会得到:

$ meteor add jquery@3.0.0
-error: Conflict: Constraint jquery@1.0.0 is not satisfied by jquery       
3.0.0.
Constraints on package "jquery":
* jquery@3.0.0 <- top level
* jquery@1.11.9 || 3.0.0 <- blaze 2.3.4 <- accounts-base 1.5.0 <-
accounts-password 1.5.3
* jquery@1.11.9 || 3.0.0 <- blaze 2.3.4 <- blaze-html-templates
1.1.2
* jquery@1.0.0 <- iron:dynamic-template 1.0.12 <- iron:controller
1.0.12 <- iron:router 1.1.2
* jquery@1.0.0 <- iron:location 1.0.11 <- iron:router 1.1.2

最初,我很难看到它从哪里获得iron:*依赖项的1.0.0,因为没有列出明确的版本:

  • https://github.com/iron-meteor/iron-dynamic-template/blob/devel/package.js#L14
  • https://github.com/iron-meteor/iron-location/blob/master/package.js#L13

然后我在api.versionsFrom(meteorRelease):的文档中发现了这一点

使用某个版本的核心包版本。除非提供,否则所有软件包都将默认为与metroRelease一起发布的版本。这将使您不必计算出要使用的核心包的确切版本。例如,如果最新发布的流星`METEOR@0.9.0它包括jquery@1.0.0,您可以从('METEOR@0.9.0'(,并且当您稍后编写api.use('jquery'(时,它将等效于api.use('jquery@1.0.0’(。

所以这似乎就是正在发生的事情——jquery@1.0.0被绑定到CCD_ 10。


所以。。。除了将iron-*包作为自定义包签出到我的本地项目中,以覆盖到现代版本的自定义分叉中的api.versionsFrom(meteorRelease)(或者更确切地说,指定一个特定的jquery版本,因为我认为它不再是核心包(之外。。。是否有任何方法可以强制更新到jquery@3.0.0,尽管它认为这是一个冲突?

不幸的是,--allow-incompatible-update在这种情况下似乎不起作用。

这有点固执己见,但如果你想拥有一个不依赖于过时包的路由器,你应该使用ostrio:flow-router-extra,它甚至允许你省略jQuery或使用npm包安装jQuery。

由于Meteor 1.8.3,Blaze和jQuery之间也没有硬依赖关系,因此可以从npm注册表安装最新的jQuery,这从安全角度来看很重要。

退房时间:https://github.com/VeliovGroup/flow-routerhttps://github.com/meteor/meteor/blob/devel/History.md

使用@=安装特定的pkg版本。如果您降级,那么就需要删除npm-jquery pkg。

meteor add jquery@=1.11.11
meteor npm remove jquery
meteor add iron:router

最新更新