我检查了github Dependabot alert: Inefficient Regular Expression Complexity in nth-check page 并在该页面上尝试了许多解决方法,但没有一个有效,问题仍然存在。
在我的 GitHub 存储库的安全选项卡上,我有以下警告:
nth-check #1 中低效的正则表达式复杂性
升级 nth-check 以修复 frontend/package-lock.json 中的 1 个 Dependabot 警报
将 nth-check 升级到 2.0.1 或更高版本。例如:
"dependencies": {
"nth-check": ">=2.0.1"
}
"devDependencies": {
"nth-check": ">=2.0.1"
}
然后我安装了
nth-check
并将react-scripts
移动到devDependencies
如下图:
"dependencies": {
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@mui/icons-material": "^5.11.11",
"@mui/material": "^5.11.11",
"@mui/x-data-grid": "^6.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.3.4",
"notistack": "^3.0.1",
"nth-check": "^2.1.1",
"react": "^18.2.0",
"react-circular-progressbar": "^2.1.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.8.2",
"recharts": "^2.4.3",
"sass": "^1.58.3",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"react-scripts": "^5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
然后运行
npm audit --production
就没有问题了。之后,我将更改推送到 GitHub,但仍然是相同的警告。
那么,我该如何解决