【发布时间】:2022-08-05 20:08:17
【问题描述】:
我阅读了很多与npm audit 相关的questions/articles,其中人们以表格格式提供了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)
-
我不想把它告诉你,但
npm audit --help会告诉你如果这是一个选项它是如何完成的。也许 mac/linux/windows 版本的节点之间存在实现差异?我不确定...尽管它提供的是--json参数,但它与 shell 脚本一样好。你真正需要它做什么? -
@KamilJanowski 非常感谢您的回复。我知道
--json部分,但它只会以JSON格式显示。我正在寻找一些可以美化npm audit output的命令或附加包。我正在使用Macos来开发我的应用程序。
标签: node.js npm report npm-audit