I am trying to use web3 in React but keep running into nth-check vulnerability when I try to install web3 packages. After googling I realized that this has been a common problem and can usually be ignored since it will never be triggered from the user end. However, this issue stops me from installing web3 and I am not sure how I can ignore it in this case.
Warnings are shown as follows:
What I have tried:
- Move ‘react-scripts’ into ‘devDependencies’ and run
npm audit --production
. (Same vulnerabilities were found) - Run
npm audit fix
andnpm audit fix --force
. (Even more vulnerabilities were found)
Related posts tried but failed:
- github Dependabot alert: Inefficient Regular Expression Complexity in nth-check
- React NPM inefficient regular expression complexity in nth-check
I tried the same thing last year and everything went smoothly. I wonder how I can get rid of these and import web3 in my React project. Really appreciated if anyone could help me on this and thanks in advance!
Zieac is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1