【问题标题】:Npm audit issuesNpm 审计问题
【发布时间】:2021-08-11 13:19:51
【问题描述】:

有人可以解释一下这是什么意思以及我如何解决它。 这是我尝试全局运行“npm audit fix”命令时遇到的错误

gomer@Gomers-MBP ~ % npm audit fix                        
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: web-project@0.0.0
npm ERR! Found: @angular/compiler-cli@8.2.14
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/build-angular@12.0.1
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 ~ % 

谢谢

【问题讨论】:

    标签: npm audit


    【解决方案1】:

    为什么要在全球范围内运行它?

    在适当的包目录中运行它,这样它就可以修复包依赖项中的漏洞。你用错了。

    我建议阅读有关如何使用它的信息: https://docs.npmjs.com/cli/v7/commands/npm-audit

    【讨论】:

      猜你喜欢
      • 2019-01-12
      • 1970-01-01
      • 1970-01-01
      • 2018-11-18
      • 2011-05-26
      • 2020-06-30
      • 1970-01-01
      • 2021-09-07
      • 2013-04-25
      相关资源
      最近更新 更多