Github has flagged a dependency in my app lock file as vulnerable.
To fix it I should updated that package to a newer version.
How do I do that if I don't have any control on the vulnerable package, because is nested in the dependencies tree?
Apologies if this is a very basic question but I don't seem to find anything useful regarding this.
Remove the nested dependency under the 'requires' section in package-lock. json. Add the updated dependency under DevDependencies in package. json, so that modules that require it will still be able to access it.
You're correct - as the vulnerable package lies within one of your dependencies, like so:
Your Package -> Dependency -> Vulnerable package
You will be unable to update the dependencies' dependency in a way that would survive a future npm install
or yarn
.
However, you could take the following approaches:
package.json
.See this answer for more information on installing directly from Github repos.
This approach will fix the problem short term, but it is not advised as you won't benefit from any bug fixes the maintainer makes, and besides, by the time you've done this the dependency might have been updated anyway!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With