npm视图获取更多项目 [英] npm view get more items

查看:96
本文介绍了npm视图获取更多项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下命令查找我拥有的软件包的版本。

I am using the following command to look up versions of the packages that I have.

npm view< packagename>版本

我得到的结果如下

  '2.4.0-2016-10-06-6743',
  '2.4.0-2016-10-07-6750',
  '2.4.0-2016-10-07-6751',
  '2.4.0-2016-10-07-6754',
  '2.4.0-2016-10-07-6755',
  '2.4.0-2016-10-10-6763',
  '2.4.0-2016-10-11-6770',
  '2.4.0-2016-10-11-6790',
  '2.4.0-2016-10-12-6799',
  '2.4.0-2016-10-12-6800',
  '2.4.0-2016-10-13-6806',
  '2.4.0-2016-10-13-6807',
  '2.4.0-2016-10-13-6808',
  '2.4.0-2016-10-14-6810',
  ... 37 more items ]

我想获得所有可以看到结果,还有 37个项目未显示。

I want to get all the results as you can see there are 37 more items which are not shown.

如何获取所有结果

我在Windows上使用Windows命令提示符以及gitbash工具。

I am using windows command prompt as well as the gitbash tool on windows.

推荐答案

尝试在命令中添加-json

npm view <packagename> versions --json




这是对util行为的更改。在较新版本的Node.js中检查(我猜-这不是npm CLI团队更改的行为)。如果要获取完整列表,并且还想确保它是可解析的,只需将--json添加到命令中,即可将JSON.stringify()的原始输出应用于该包的元数据。

This is a change to the behavior of util.inspect() in newer versions of Node.js (I'm guessing – this isn't behavior that the npm CLI team changed). If you want to get the full list, and also want to ensure that it's parseable, just add --json to the command, to get the raw output of JSON.stringify() applied to that piece of the package's metadata.

https://github.com/npm/npm/issues/13376#issuecomment-232525623

这篇关于npm视图获取更多项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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