首页 > 解决方案 > react-bootstrap-table-next@4.0.3 需要 underscore@1.9.1 最早的固定版本是 1.12.1 - Dependabot alert

问题描述

嗨,收到了依赖机器人警报

react-bootstrap-table-next@4.0.3 requires underscore@1.9.1 The earliest fixed version is 1.12.1 - Dependabot alert

要在 package.json 添加解决此underscore: 1.12.1问题,但问题未解决,因为 package.lock.json 仍然显示

"react-bootstrap-table-next": {
        "version": "4.0.3",
        "resolved": "https://registry.npmjs.org/react-bootstrap-table-next/-/react-bootstrap-table-next-4.0.3.tgz",
        "integrity": "sha512-uKxC73qUdUfusRf2uzDfMiF9LvTG5vuhTZa0lbAgHWSLLLaKTsI0iHf1e4+c7gP71q8dFsp7StvkP65SxC1JRg==",
        "requires": {
            "classnames": "^2.2.5",
            "react-transition-group": "^4.2.0",
            "underscore": "1.9.1"
        }

如何修复这种依赖机器人警报,我们无法更新underscore另一个库所需的库 ex,react-bootstrap-table-next并且我们无法更新react-bootstrap-table-next,因为react-bootstrap-table-next已经是最新的,我们无法更新。

否则我们必须等待下一个版本的发布react-bootstrap-table-next

标签: javascriptreactjssecuritygithubunderscore.js

解决方案


这是通用解决方案how-do-i-fix-a-vulnerable-npm-package-in-my-package-lock-json-that-isnt-listed

在这种情况下,当依赖包需要更新时,我们需要检查父包是否已经修复它,我们可以安装新的父包。

例如,在上述情况下underscorereact-bootstrap-table-next我们可以继续检查是否react-bootstrap-table-next已经修复了警报和更新underscore包,如果他们有更新,我们可以安装最新react-bootstrap-table-next的,如果没有更新,我们可以等待下一个版本选择其他替代包


推荐阅读