3

I've been doing an Angular 9 project for some time now. A while back, a warning popped up about a moderate security vulnarability with the minimist package. However, when I try to fix them with (sudo) npm audit fix, it can't fix these issues, and (sudo) npm update won't update them either, even though they have newer versions. How can I fix this?

You can reproduce this problem with a brand new Angular 9 application; minimist is installed by default. For a new project, they will show up as a 'low' level vulnerability, but I think the gist of it is the same.

Luctia
  • 322
  • 1
  • 5
  • 17

2 Answers2

3

This is great question. I do this to fix the vulnerability issue.

Add this in package.json like last entry after devDependencies;

"resolutions": {
        "minimist": "^1.2.5"
 }

and in scripts section add:

  "scripts": {
    "preinstall": "npx npm-force-resolutions"`
  }

when you finish run this in your terminal:

npx npm-force-resolutions && npm install

But when installing a new package it usually go back to the previous version and I run the previous command again.

Javier López
  • 99
  • 1
  • 5
2

At the moment you can't fix it, because angular 9 is not compatible with (new) minimist version, which do not have vulerabilities. You can follow the issues on github:

https://github.com/substack/minimist/issues/145

https://github.com/angular/angular/issues/36104

SAM
  • 742
  • 10
  • 24