我正在启动一个新的react项目,并且我只安装了非常基本的包(npx create-react-app),没有安装其他任何东西。当我运行审计时,我得到以下低漏洞:
=== npm audit security report ===
┌──────────────────────────────────────────────────────────────────────────────┐
│ Manual Review │
│ Some vulnerabilities require your attention to resolve │
│ │
│ Visit https://go.npm.me/audit-guide for additional guidance │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-scripts │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ react-scripts > webpack-dev-server > yargs > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1500 │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 1 low severity vulnerability in 1896 scanned packages
1 vulnerability requires manual review. See the full report for details.我尝试了google,并到处寻找解决这个问题的方法,我重新安装了yargs-parser包,但没有成功,并多次尝试重新安装该项目。
任何帮助都将不胜感激。
发布于 2020-05-06 13:20:51
目前还没有立马解决的办法。自从固定在react-scripts中的版本以来,yargs-parser在已经发布的版本中有了突破性的变化。我们正在等待react-scripts的更新,以解决此警告。
值得注意的是,这不是一个“严重”的漏洞,应该只影响开发环境。这个问题在最新的yargs-parser中已经修复了,但我不会因为一个低风险漏洞而失眠。它们时不时地发生,社区通常很擅长修补它们。
您可以查看此问题的进度,或者(取决于您的技能水平)在此处为修复做出贡献:https://github.com/facebook/create-react-app/issues/8529
发布于 2020-05-06 16:59:18
我们还需要添加以下内容:
强制“脚本”:{“预安装”:"npx npm--“}
然后在你的package.json上添加:
解析器“解析”:{“yargs-”:"^13.1.2“}
最后在你的终端上运行下面的commond:
rm -r node_modules
npm安装
https://stackoverflow.com/questions/61535702
复制相似问题