错误解决:webpack---optional SKIPPING OPTIONAL DEPENDENCY: fsevents...
程序员文章站
2022-05-29 23:43:12
...
npm install的时候,报了以下内容 [email protected]…
PS F:\web\ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: 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)
遇到问题不要慌,看错误提示,一步一步解决。