首先安装npm-audit-html
npm i -g npm-audit-html
然后输出报告
npm audit --json | npm-audit-html
结果report.html会创建在根目录,打开后如图所示
注意事项
如果你使用的是淘宝或者华为镜像源,你将无法使用npm audit的功能,需要换回官方的源
npm config set registry https://registry.npmjs.org/
参考资料
npm-auditDisplay npm audit vulnerabilities in html format
学习技术最好的文档就是【官方文档】,没有之一。
还有学习资料【Microsoft Learn】、【CSharp Learn】、【My Note】。
如果,你希望更容易地发现我的新博客,不妨点击一下【关注】。