fix

npm ------ npm audit fix 或 npm audit 用法

左心房为你撑大大i 提交于 2019-11-26 13:18:53
一般在npm install 依赖包后,会跳出来该命令 npm audit : npm@5.10.0 & npm@6,允许开发人员分析复杂的代码,并查明特定的漏洞和缺陷。 npm audit fix :npm@6.1.0, 检测项目依赖中的漏洞并自动安装需要更新的有漏洞的依赖,而不必再自己进行跟踪和修复。 1. 运行audit fix,但是只更新pkglock, 不更新node_modules: $ npm audit fix --package-lock-only 2. 只更新dependencies中安装的包,跳过devDependencies中的包: $ npm audit fix --only=prod 3.运行命令,得到audit fix将会更新的内容,并且输出json格式的安装信息,但是并不真的安装更新: $ npm audit fix --dry-run --json 4. 得到json格式的详细检测报告 $ npm audit --json 来源: https://blog.csdn.net/COCOLI_BK/article/details/98874446