node.js - npm view 获取更多项目

标签 node.js cmd npm git-bash

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

npm view <packagename> versions

我得到的结果如下

  '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 more items哪些没有显示。

我怎样才能得到所有的结果。

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

最佳答案

尝试在命令中添加--json

npm view <packagename> versions --json

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

关于node.js - npm view 获取更多项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40565331/

相关文章:

batch-file - 如果存在计划任务

node.js - 在 Linux 中安装 Node 和 NPM

node.js - "error stream.push() after EOF"使用 "npm cache verify"时

node.js - 如何使用 Express 和 NGINX 设置路由?

node.js - 在 CentOS 上运行 Docker 的 NPM 安装错误

.net - 通过CMD运行 SandcaSTLe 帮助文件生成器时,$(SolutionDir)MSBuild属性不正确

gradle - 如何编写一个 gradle 构建任务,在与我的 gradle 构建文件不同的目录中运行诸如 "npm install"之类的脚本?

javascript - Axios Post 请求在 React JS 中不起作用

javascript - Node JS 安装提前结束

c++ - ShellExecute 中的 cmd 命令