在 NPM 中获取包的先前版本 [英] Get previous versions of a package in NPM

查看:45
本文介绍了在 NPM 中获取包的先前版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 npm 找出包的所有先前版本?

How do I find out all previous versions of a package using npm?

在这种情况下,我对科尔多瓦感兴趣.如果我执行 npm install -g cordova,我将安装最新版本(这正是您所期望的).

In this instance, I am interested in cordova. If I execute npm install -g cordova, I will install the latest version (which is what you'd expect).

如果我执行 npm install -g cordova@3.1.0-0.1.0 然后我安装了特定版本 - 我想知道,因为我在使用最新版本的 a包,并想测试出现问题的版本 - 但如果我不知道有哪些 npm 包版本,则无法测试.

If I do npm install -g cordova@3.1.0-0.1.0 then I get the specific version installed - I would like to know because I am having troubles with the latest version of a package, and would like to test which version the problem occurred in - but cannot do that if I don't know which npm package versions there have been.

推荐答案

尝试:

在您的终端中:

npm view cordova versions

输出:

[ '0.0.0-fake',
  '0.0.1',
  '0.0.2',
  '0.0.3',
  '0.0.4',
  '0.0.5',
  '0.0.6',
  '0.0.7',
  '0.0.8',
  '0.0.9',
  '0.1.0',
  '0.1.1',
  '0.1.2',
  '0.1.3',
  '0.1.4',
  '0.1.5',
  '0.1.6',
  '0.1.7',
  '0.1.8',
  '0.1.9',
  '0.1.10',
  '0.1.11',
  '0.1.12',
  '0.1.13',
  '0.1.14',
  '2.2.0',
  '2.3.0',
  '2.3.1',
  '2.3.2',
  '2.3.3',
  '2.3.5',
  '2.3.6',
  '2.4.0',
  '2.4.1',
  '2.4.2',
  '2.4.3',
  '2.4.4',
  '2.4.5',
  '2.4.6',
  '2.4.7',
  '2.4.8',
  '2.4.9',
  '2.4.10',
  '2.5.0',
  '2.5.2',
  '2.5.3',
  '2.5.4',
  '2.5.5',
  '2.6.0',
  '2.6.1',
  '2.6.2',
  '2.7.0-rc.1',
  '2.7.1-rc.1',
  '2.7.2',
  '2.7.3',
  '2.7.4',
  '2.8.0',
  '2.8.1',
  '2.8.2',
  '2.8.3',
  '2.8.4',
  '2.8.5',
  '2.8.6',
  '2.8.7',
  '2.8.8',
  '2.8.9',
  '2.8.10',
  '2.8.11',
  '2.8.12',
  '2.8.13',
  '2.8.14',
  '2.8.15',
  '2.8.16',
  '2.8.17',
  '2.8.18',
  '2.8.19',
  '2.8.20',
  '2.8.21',
  '2.8.22',
  '2.8.23',
  '2.8.24',
  '2.8.25',
  '2.9.0-rc1',
  '2.9.0',
  '2.9.1',
  '2.9.2',
  '2.9.3',
  '2.9.4',
  '2.9.5',
  '2.9.6',
  '2.9.7',
  '3.0.0-rc1',
  '3.0.0-rc1-1',
  '3.0.0-rc1-3',
  '3.0.0',
  '3.0.1',
  '3.0.2',
  '3.0.3',
  '3.0.4',
  '3.0.5',
  '3.0.6',
  '3.0.7',
  '3.0.8',
  '3.0.9',
  '3.0.10',
  '3.1.0-0.1.0',
  '3.1.0-0.2.0',
  '3.2.0-0.1.0',
  '3.2.0-0.2.0',
  '3.2.0-0.3.0',
  '3.2.0-0.4.0',
  '3.2.0-rc.1',
  '3.3.0-0.1.1',
  '3.3.0-rc.1',
  '3.3.1-0.1.2',
  '3.3.1-0.3.0',
  '3.3.1-0.3.1',
  '3.3.1-0.4.1',
  '3.3.1-0.4.2',
  '3.4.0-0.1.0',
  '3.4.0-0.1.1',
  '3.4.0-0.1.2',
  '3.4.0-0.1.3',
  '3.4.1-0.1.0',
  '3.5.0-0.2.0',
  '3.5.0-0.2.1',
  '3.5.0-0.2.2',
  '3.5.0-0.2.3',
  '3.5.0-0.2.4',
  '3.5.0-0.2.6',
  '3.5.0-0.2.7',
  '3.6.0-0.2.8',
  '3.6.0-0.2.9',
  '3.6.1-0.2.10',
  '3.6.3-0.2.11',
  '3.6.3-0.2.12',
  '3.6.3-0.2.13',
  '4.0.0',
  '4.0.1',
  '4.1.0',
  '4.1.1',
  '4.1.2',
  '4.1.3-nightly.2014.10.21',
  '4.2.0',
  '4.3.0',
  '4.3.1',
  '5.0.0',
  '5.1.1',
  '5.2.0',
  '5.3.1',
  '5.3.3',
  '5.4.0' ]

那应该会列出您正在寻找的旧版本的包——在本例中,包是cordova".

That should list the old versions of the package you're looking for -- in this case, the package is "cordova."

然后你可以使用你选择安装的任何 npm install 命令来安装你想要的.

Then you can install what you want using whichever npm install command you choose to install with.

这篇关于在 NPM 中获取包的先前版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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