Search code examples
javascriptnode.jspackagemocha.jsnyc

nyc Regular Expression Denial of Service vulnerability while running the npm test


I am new to nodejs, How to fix the nyc Regular Expression Denial of Service vulnerability? npm audit is giving this vulnerability while running the npm test.

Moderate: Regular Expression Denial of Service  
Package: browserslist
Dependency of: nyc [dev]  
Path: nyc > istanbul-lib-instrument > @babel/core > @babel/helper-compilation-targets > browserslist

In my package.json I have nyc dev dependency:

"nyc": "^15.1.0"

Thanks in advance.


Solution

  • When I cleared the cache and then run npm install it worked.