执行npm install 出现如下提醒

 
  1. added 253 packages from 162 contributors and audited 1117 packages in 42.157s

  2. found 5 vulnerabilities (1 low, 4 high)

  3. run `npm audit fix` to fix them, or `npm audit` for details html

按照控制台提示的命令,输入‘npm audit fix’后,控制台提示:

 
  1. 1 package update for 5 vulns involved breaking changes

  2. (use `npm audit fix --force` to install breaking changes; or do it by hand)

输入:‘npm audit fix --force’后,控制台提示:

 
  1. added 199 packages from 111 contributors, removed 64 packages and updated 23 packages in 42.194sfixed 5 of 5 vulnerabilities in 1117 scanned packages

  2. 1 package update for 5 vulns involved breaking changes

  3. (installed due to `--force` option)

重新输入‘npm audit’:

 
  1. === npm audit security report ===

  2. found 0 vulnerabilities

  3. in 4598 scanned packages

终于一切正常。

出于好奇,从npm官网上查阅了对于npm audit fix的相关介绍。

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

最新文章

  1. [NOIP2015] 提高组 洛谷P2680 运输计划
  2. Linux多线程编程阅读链接
  3. zoj 3742 Delivery 好题
  4. Fixing:insert_modules not found
  5. pandas.DataFrame 中save方法
  6. Linux配置vnc
  7. Activiti工作流(一)之基本操作介绍
  8. POJ-3522 Slim Span(最小生成树)
  9. web.config中的configSource
  10. 10倍速!一招儿解决因googleapis被墙导致的许多国外网站访问速度慢的问题
  11. mysql查询数据
  12. LabelImg 图像图像标注工具
  13. MBR (主引导记录)
  14. Bayes’s formula for Conditional Probability
  15. [原]F5负载均衡激活license
  16. ADODB 调用存储过程
  17. SHT20 IIC总线驱动概述
  18. UsageGrideReport++
  19. Python 将json字符串 进行列表化可循环
  20. Windows和Ubuntu双系统

热门文章

  1. xshell5 可用注册码
  2. [转]Apache的CRT格式SSL证书转换成IIS用的PFX格式
  3. Oracle 完整性约束错误
  4. “互联网+”背景下使用微信公众号增强班主任工作与整合教学资源(泰微课)
  5. magento2常见的命令
  6. ECharts.js学习(三)交互组件
  7. .Net Intelligencia.UrlRewriter 重定向参数中文支持配置方法
  8. C++中在子类实现父类的方法调用
  9. cocos2d-x3.0 后配置信息重置
  10. DOM操作怎样添加、移除、移动、复制。创建和查找节点?