Search code examples
npmaudit

Npm audit issues


can someone plz explain what this means and how i fix it. This is the error i get when ever i try to run the "npm audit fix" command globaly

gomer@Gomers-MBP ~ % npm audit fix                        
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"~8.2.11" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler-cli@"^12.0.0" from @angular-devkit/[email protected]
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"^12.0.1" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/gomer/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/gomer/.npm/_logs/2021-05-22T16_02_12_140Z-debug.log
gomer@Gomers-MBP ~ % 

thx


Solution

  • Why are you running this globally?

    Run it in the appropriate package directory so it can possibly fix vulnerabilities in your package's dependencies. You're using it incorrectly.

    I advise reading about how to use it: https://docs.npmjs.com/cli/v7/commands/npm-audit