Closed joebowbeer closed 2 years ago
Thanks for a very thorough report. If you could also provide the version number of npm-audit-resolver you used I should be able to reproduce.
npm-audit-resolver@1.5.0
I don't see how it could have happened yet. Could you share your package-lock from before and after the working fix?
It is not easy to return to this state but if I encounter something similar I'll try to isolate a repro.
My workaround now is to run audit fix first to let it do what it can before running resolve-audit.
Ok, no worries.
I was hoping you had package lock file committed to git so the broken version would be easy to find in history.
I just reproduced it in one of my repos.
Note that if you run npm audit
and then take the command it prints as a fix for the single issue it doesn't fix the issue, but npm audit fix
does.
That means if resolver only gets the output of audit -> not much I can do. Let's ask some npm people.
I just came across this. I think it's related to https://github.com/npm/cli/issues/394
When "fix" runs npm update lodash --depth 2
, the audit-resolve.json is created and marks them as fixed but there is no change to the package-lock.json
This is the simplest package-lock.json repro i could make
{
"name": "x",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"async": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz",
"integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==",
"requires": {
"lodash": "^4.14.0"
},
"dependencies": {
"lodash": {
"version": "4.17.20",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
}
}
}
}
}
I think this must be an npm
bug - I can repro the above, but just running npm update lodash --depth 2
with no npm-audit-resolver
involved has the same issue.
npm7 no longer produces individual fix commands.
Closing this, no more reasonable options to support fixing and marking as fixed.
When I was trying to fix the recent js-yaml issue, the
npm update
invoked by npm-audit-resolver claims to have succeeded but I had to runnpm audit fix
to actually fix the issue.Steps:
I installed npm-audit-resolver as a devDependency and added a
audit-resolver
script to package.json that runs resolve-audit.However, npm audit (and check-audit) still complains about the first problem and
npm audit fix
is needed to fix it.Fixing:
Verifying: