在我安装了一个包之后,我收到了这样的消息:
added 1 package from 8 contributors and audited 49729 packages in 23.754s
found 25 vulnerabilities (1 low, 24 high)
run `npm audit fix` to fix them, or `npm audit` for details所以我运行了npm audit fix,它修复了一些漏洞。
...
+ @angular-devkit/build-ng-packagr@0.800.2
+ @angular-devkit/build-angular@0.800.2
added 125 packages from 72 contributors, updated 8 packages and moved 16 packages in 65.005s
fixed 12 of 25 vulnerabilities in 49729 scanned packages
3 package updates for 13 vulns involved breaking changes
(use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)它建议使用npm审计修复--force,我使用了它,现在当我尝试运行Angular应用程序时,它得到了这个错误:
Schema validation failed with the following errors:
Data path ".builders['app-shell']" should have required property 'class'.
Error: Schema validation failed with the following errors:发生了什么,我应该使用npm审计修复还是忽略警告。我怎样才能让我的应用程序再次工作?
在我运行强制修复之后,它显示了这条消息,但已经太晚了,已经运行了命令:
npm WARN using --force I sure hope you know what you are doing.已安装的软件包:
发布于 2019-06-10 23:38:13
请始终小心使用--force标志。这就像通过拔出电缆来关闭计算机一样。你基本上是在“强迫”NPM去做你想让它做的事情,即使NPM知道你的应用程序会崩溃。
要解决此问题,您必须手动恢复更改。
您还可以尝试运行npm update。它将更新每个包(但之前备份您的项目!)。也许这就足以修复它了。
如果将来必须修复漏洞,请在不使用--force标志的情况下进行。如果这不起作用,可以通过运行npm audit手动执行:它将向您显示问题的详细信息,而不需要执行任何操作。
https://stackoverflow.com/questions/56522180
复制相似问题