NodeJS npm审核响应仅显示为纯文本而不是表格格式

zujrkrfu  于 2022-11-22  发布在  Node.js
关注(0)|答案(2)|浏览(125)

我读了很多与npm audit相关的questions/文章,其中人们以表格格式提供了npm audit的响应。但当我运行npm audit时,我得到的响应是纯文本。
我尝试安装一个库npm-audit-html,并获取answer中提供的HTML格式,但遇到了问题:zsh: command not found: npm-audit-html
有人能解释一下并帮助解决npm audit响应的美化问题吗?目前,我的npm audit响应显示如下:

postcss-overflow-shorthand  <=2.0.0
  Depends on vulnerable versions of postcss
  node_modules/postcss-overflow-shorthand
  postcss-page-break  <=2.0.0
  Depends on vulnerable versions of postcss
  node_modules/postcss-page-break
  postcss-place  <=5.0.0
  Depends on vulnerable versions of postcss
  node_modules/postcss-place
  postcss-pseudo-class-any-link  <=6.0.0
  Depends on vulnerable versions of postcss
  node_modules/postcss-pseudo-class-any-link
  postcss-reduce-initial  <=4.0.3
  Depends on vulnerable versions of postcss
  node_modules/postcss-reduce-initial
  postcss-reduce-transforms  <=4.0.2
  Depends on vulnerable versions of postcss
  node_modules/postcss-reduce-transforms
  postcss-replace-overflow-wrap  <=3.0.0
  Depends on vulnerable versions of postcss
  node_modules/postcss-replace-overflow-wrap
  postcss-selector-matches  *
  Depends on vulnerable versions of postcss
  node_modules/postcss-selector-matches
  postcss-selector-not  <=4.0.1
  Depends on vulnerable versions of postcss
  node_modules/postcss-selector-not
  postcss-svgo  <=5.0.0-rc.2
  Depends on vulnerable versions of postcss
  Depends on vulnerable versions of svgo
  node_modules/postcss-svgo
  postcss-unique-selectors  <=4.0.1
  Depends on vulnerable versions of postcss
  node_modules/postcss-unique-selectors
  postcss-url  3.3.0 - 10.0.0
  Depends on vulnerable versions of postcss
  node_modules/postcss-url
  stylehacks  <=4.0.3
  Depends on vulnerable versions of postcss
  node_modules/stylehacks

90 vulnerabilities (84 moderate, 6 high)
lp0sw83n

lp0sw83n1#

在Windows中,我使用了带有“〉”的npm审计来将其内容写入json文件,请参考以下命令:

npm audit --json > FOLDER_PATH\FILE_NAME.json
um6iljoc

um6iljoc2#

你发布的npm audit是npm 7的一个突破性变化。
对输出和数据结构进行了重大重构,以引起对问题的注意,确定以前不可用的修复类别,并删除不用于任何目的的无关数据。
突破性变化:任何使用npm audit输出的工具几乎肯定都需要更新,因为这在可读和--json输出样式上都发生了显著变化。

由于输出格式没有正式解释,有一个post尝试找到它。你可以查看帖子了解更多细节。

相关问题