npm WARN optional SKIPPING OPTIONAL DEPENDENCY

无人久伴 提交于 2020-03-01 10:23:25

npm install的时候,报了以下内容 fsevents@....

PS F:\web\ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

audited 20486 packages in 19.838s
found 10 vulnerabilities (5 low, 4 moderate, 1 critical)
run `npm audit fix` to fix them, or `npm audit` for details

这个问题在win/linux使用时,就会报警告, 因为fsevents的依赖属于mac操作系统,所以 忽视即可

 

并且发现10个漏洞(found 10 vulnerabilities)

控制台提示 run 'npm audit fix' ,执行完了,如下:

updated 4 packages in 25.094s
fixed 1 of 10 vulnerabilities in 20486 scanned packages
  2 vulnerabilities required manual review and could not be updated
  2 package updates for 7 vulns involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)

 

npm audit :分析复杂的代码,并找出漏洞和缺陷

npm audit fix  :检测项目依赖中的漏洞并自动安装需要更新的有漏洞的依赖或修复

 

最后根据提示执行npm audit fix --force 进行install,应该OK了

added 70 packages from 91 contributors, removed 21 packages and updated 1 package in 26.719s
fixed 4 of 6 vulnerabilities in 20486 scanned packages
  2 vulnerabilities required manual review and could not be updated
  1 package update for 4 vulns involved breaking changes
  (installed due to `--force` option)

 

虽然不会前端,但也要会看提示,慢慢学习

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!