[英]How/should I update an npm package when it is not the wanted one?
I've been trying to query data on Firebase using querying lists . 我一直在尝试使用查询列表在Firebase上查询数据。
When I attempt something analogous to what is described in that documentation: 当我尝试类似于该文档中描述的内容时:
getMatchesFiltered(matchId: string, filter: string, sortDirection: string, pageIndex: number, pageSize: number){
let queryObservable = this.db.list('/matches', ref => ref.orderByKey(true).limitToFirst(2));
return queryObservable;
}
I got an "Argument of type '{ query: { ...}; }' is not assignable to parameter of type 'FirebaseListFactoryOpts' " error, which led me to this helpful SO post . 我收到“无法将类型'{query:{...};}的参数分配给类型'FirebaseListFactoryOpts'的参数”的错误,这导致我转向了这篇很有帮助的SO帖子 。 However, when I tried to change the above to
但是,当我尝试将以上内容更改为
getMatchesFiltered(matchId: string, filter: string, sortDirection: string, pageIndex: number, pageSize: number): AngularFireList<Match[]>{
let queryObservable = this.db.list('/matches', ref => ref.orderByKey(true).limitToFirst(2).valueChanges());
return queryObservable;
}
and add AngularFireList to the 'angularfire2/database' imports, I get the following error: 并将AngularFireList添加到'angularfire2 / database'导入中,出现以下错误:
ERROR in src/app/database.service.ts(7,81): error TS2305: Module '"/Users/mf/Desktop/dataJitsu/node_modules/angularfire2/database"' has no exported member 'AngularFireList'.
src / app / database.service.ts(7,81)中的错误:错误TS2305:模块'“ / Users / mf / Desktop / dataJitsu / node_modules / angularfire2 / database”'没有导出的成员'AngularFireList'。
This suggests to me that perhaps I have an old version of angularfire2? 这向我暗示也许我有angularfire2的旧版本? Indeed, my package.json says,
确实,我的package.json说,
"angularfire2": "^4.0.0-rc0",
And I believe that the new AngularFireList list stuff is from v. 5.xx? 而且我相信新的AngularFireList列表内容来自5.xx版?
However, when I try to update, it doesn't let me. 但是,当我尝试更新时,它不允许我进行更新。 When I run npm outdated, this is what I see:
当我运行过时的npm时,这是我看到的:
Note that the WANTED version of angularfire2 is still 4.0.0-rc0. 请注意,angularfire2的WANTED版本仍为4.0.0-rc0。
Which brings us finally to my question: How do I figure out which package(s) want my versions to stay where they are? 最终,这使我们想到了一个问题:我如何确定哪个软件包希望我的版本保持原样? In other words, what's holding me back from updating further?
换句话说,是什么让我无法进一步更新? Alternatively, if anyone knows how to solve this problem on the angularfire2 front, I'm all ears for that, too.
另外,如果有人知道如何在angularfire2前端解决此问题,我也很乐意这样做。
The Wanted Version
stays at 4.0.0-rc0 because of Semantic Versioning in your package.json
("angularfire2": "^4.0.0-rc0") 由于
package.json
(“ angularfire2”:“ ^ 4.0.0-rc0”)中的语义版本控制 ,所需Version
保持在4.0.0-rc0 package.json
As a consumer, you can specify which kinds of updates your app can accept in the package.json file.
作为使用者,您可以在package.json文件中指定您的应用程序可以接受的更新类型。
If you were starting with a package 1.0.4, this is how you would specify the ranges:
如果您从软件包1.0.4开始,这就是您指定范围的方式:
- Patch releases: 1.0 or 1.0.x or ~1.0.4
修补程序版本:1.0或1.0.x或〜1.0.4
- Minor releases: 1 or 1.x or ^1.0.4
次要版本:1或1.x或^ 1.0.4
- Major releases: * or x
主要版本:*或x
The other issue is hard to say without seeing more relevant code. 如果没有看到更多相关代码,很难说另一个问题。 I would start with checkig this post
我将开始与checkig 这个职位
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.