npm`想要`vs`最新` [英] npm `wanted` vs `latest`

查看:83
本文介绍了npm`想要`vs`最新`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用npm安装一些命令行工具.渴望永远保持最新状态,我找到了命令npm -g outdated.

I use npm to install some command line tools. Having the itch to always be up to date, I found the command npm -g outdated.

wantedlatest有什么区别?

文档指出:

根据[ 在package.json中指定的版本,该字段最新" 该软件包的最新版本.

The resulting field 'wanted' shows the latest version according to the version specified in the package.json, the field 'latest' the very latest version of the package.

但是我根本不清楚. 例如,在我的系统上,我得到:

However I don't find it clear at all. For example on my system I get:

Package  Current  Wanted  Latest  Location
cordova    5.3.1   5.3.3   5.3.1  lib
npm        3.3.4   3.3.4   3.3.3  lib

wanted如何高于latest?似乎矛盾:

How can wanted be higher than latest? It seems to contradict:

该字段最新"为软件包的最新版本

the field 'latest' the very latest version of the package

我应该更新到哪个版本(我仅使用命令行,而不使用任何node.js代码)?

Which version should I update to (I only use the command-line, not any node.js code)?

推荐答案

在--global运行的上下文中,wanted字段没有意义,因为没有package.json来定义所需的版本.

The wanted field makes no sense in the context of a --global run as there is no package.json to define which version you require.

我应该更新到哪个版本(我仅使用命令行,而不使用任何node.js代码)?

Which version should I update to (I only use the command-line, not any node.js code)?

如果您希望生活在边缘,那么最新版本似乎是一个不错的选择.

The latest version seems as a good choice if you like to live on the edge.

通缉的专栏似乎是个错误,它在github 很多中报道了

The wanted column seems like a bug, it is reported in github many times.

文档似乎有些误导,因此请澄清一下:

The documentations seems a bit misleading so lets clarify:

结果字段"wand"根据package.json中指定的版本显示最新版本...

The resulting field 'wanted' shows the latest version according to the version specified in the package.json...

由于没有全局package.json,因此使用的版本约束为'*'(设置

As there is no global package.json, the version constrain used is '*' (set here).

然后所需的版本是根据 semver 的软件包的最新版本.

Then the wanted version is the latest version of the package according to semver.

该字段最新"为软件包的最新版本.

the field 'latest' the very latest version of the package.

那是不对的,您得到的是 dist-tag 最新",通常与最新版本匹配版本(请参见此处).有些软件包使用这些标签来管理显示的内容(例如npm).

Thats not true, what you get is the dist-tag "latest", that usually matches the latest version (see here). There are some packages that uses those tags to manage what get shown (like npm).

我应该更新到哪个版本(我仅使用命令行,而不使用任何node.js代码)?

Which version should I update to (I only use the command-line, not any node.js code)?

似乎边缘想要.

这篇关于npm`想要`vs`最新`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆