When I run npm install
it says found 33 vulnerabilities (2 low, 31 moderate)
run `npm audit fix` to fix them, or `npm audit` for details
.
If you are absolutely certain you'd like to skip the audit, you can do so by appending --no-audit
npm install --no-audit
lodash-cli
in devDependencies
doesn't affect how browser-sync
works in your project, devDependencies
are ignored when a package is installed as a dependency.
What audit
report says is that it's easy-extender
that has lodash
dependency:
browser-sync > easy-extender > lodash
It depends on Lodash 3, while the problem was fixed in Lodash 4. The problem could be fixed by forking easy-extender
, updating it and installing it instead of the package from NPM public registry. But there is no real problem with this dependency.
audit
report importance should be evaluated manually. Even if nested dependency has security risk, this doesn't mean that a feature that introduces this risk was used. This also doesn't mean that even if it's used, it introduces real risk due to how it's used.
browser-sync
is development tool that isn't used in production, there are not so many scenarios where its vulnerabilities could be exploited. And Prototype Pollution isn't a vulnerability at all, just a notice that a package doesn't follow good practices, it can be ignored.
Generally, this is the way to fix reported vulnerabilities:
Most times it's expected that you won't advance beyond a sanity check.
patch-package can help to patch nested dependencies in-place but this won't affect audit
report.
'npm audit fix' will increment the version of dependency in package.json which might lead to breaking of code. So better way is to open package-lock.json and updated the dependency/subdependency versions to required version. Maintain the package-lock.json in repository.
Sometimes vulnerabilities are from dev packages, In that case ignore those vulnerabilities as those are not getting picked up in the production.
The most of the problem occurred in my system was due to npm package. I tried,
npm un npm
You don't have to install again.
Just run program again. It worked for me.