在NPM中获取软件包的早期版本 [英] Get previous versions of a package in NPM

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

问题描述

如何使用npm查找软件包的所有先前版本?

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

在这种情况下,我对cordova感兴趣.如果执行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,那么我安装了特定版本-我想知道,因为我在软件包的最新版本方面遇到了麻烦,并且想测试问题发生在哪个版本上-但不能执行如果我不知道有哪个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天全站免登陆