Github has given me this error on one of my repositories.
We found a potential security vulnerability in one of your dependencies.
A dependency defined in ./package-lock.json has known security vulnerabilities
and should be updated.
The dependency is not defined in our package.json
file. To my understanding it isn't good practice to delete the package-lock.json
file and regenerate it. However, I cannot see any other way to fix this issue. If I dismiss this security vulnerability it will appear again a couple of days later. Any ideas? Thanks!
You should try to identify the problematic package's name, and then run
replacing package-name, obviously.
This will install the latest version of the package, and very often, the latest version has fixed the security issue. If you have a constraint on version (eg: 1.2), you can always try to:
and the latest patched version will be installed
New: now, with npm@6 you can directly run
To resolve this:
Solution1: First find the vulnerability:Using your terminal: cd into your project, then run "npm ls hoek"
And finally: npm install bcrypt@latest
Then push the updated project to git.(i.e perform a fresh commit).
Solution 2:
if the first option/solution does not resolve the issue.Change the version manually in your package-lock.json. Change your version manually from 2.16.3 to 4.2.1
Then update your project on GitHub(commit/push) Just make sure every hoek version occurrence in your package-lock.json version is changed to 4.2.1
Alternatively if you can figure out a way to change the hoek version/update hoek using npm,will make things much simpler.(something like : npm update @hoek..version)..or uninstall the specific dependency then reinstall it using bower or npm.
The simplest/easiest way to fix this is:
npm install <dep>
npm uninstall <dep>
npm update
npm install
From: https://github.com/Microsoft/vscode/issues/48783#issuecomment-384873041
Yet, this is what is usually done in this instance.
See for example angular/angular-cli issue 8534, which is resolved by PR 8535.
That leads a dependent project like
frees-io/freestyle-opscenter-webclient
to update itspackage-lock.json
: PR 31.