5

当我运行 npm audit 命令时

=== npm 审计安全报告 ===

`Manual Review 

 Some vulnerabilities require your attention to resolve 

 Visit https://go.npm.me/audit-guide for additional guidance `



High          │ Arbitrary File Overwrite                                     

Package       │ tar                                                          
Patched in    │ >=4.4.2                                                       
Dependency of │ @angular-devkit/build-angular [dev]                           
Path          │ @angular-devkit/build-angular > node-sass > node-gyp >tar 
More info     │ https://nodesecurity.io/advisories/803

它的说法found 1 high severity vulnerability in 42611 scanned packages 1 vulnerability requires manual review。由于它与@angular-devkit/build-angular,我担心它是否会在我的项目中产生任何其他问题。

当我运行 npm audit fix 命令时

    npm WARN optional SKIPPING OPTIONAL 
    DEPENDENCY:fsevents@1.2.9 (node_modules/fsevents):
    npm WARN notsup SKIPPING OPTIONAL 
    DEPENDENCY:Unsupported platform for 
    fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} 
    (current: {"os":"linux","arch":"x64"})

那么如何在任何具有 linux 操作系统的系统中解决这个问题。让我们考虑忽略上面的 npm 审计修复结果,因为它在某种程度上是一个警告。但是 npm 审计的结果被认为是一个高危漏洞。如何解决这个问题。

Angular CLI 版本

      Angular CLI: 7.3.8
      Node: 10.0.0
      OS: linux x64
      Angular: 7.2.14
      ... animations, common, compiler, compiler-cli, core, forms
      ... language-service, platform-browser, platform-browser-dynamic
      ... router

      Package                           Version
      -----------------------------------------------------------
      @angular-devkit/architect         0.13.8
      @angular-devkit/build-angular     0.13.8
      @angular-devkit/build-optimizer   0.13.8
      @angular-devkit/build-webpack     0.13.8
      @angular-devkit/core              7.3.8
      @angular-devkit/schematics        7.3.8
      @angular/cli                      7.3.8
      @ngtools/webpack                  7.3.8
      @schematics/angular               7.3.8
      @schematics/update                0.13.8
      rxjs                              6.3.3
      typescript                        3.2.4
      webpack                           4.29.0

帮我解决这个问题。谢谢你

4

2 回答 2

2

此漏洞已得到修复

删除node_modulesand package-lock.json,然后运行命令:

  1. npm install
  2. npm audit
  3. npm audit fix
  4. npm audit

Found 0 vulnerabilities会出现,问题已解决。

于 2019-05-15T19:24:20.470 回答
1

我想通过这个。这就是我为修复审计所做的。

问题是 TAR,它是 node-gyp 的依赖项。

解决方案在这里: https : //github.com/sass/node-sass/issues/2625 按照“mohsenari”的建议去做。它对我有用。

对于不支持的可选 fsevents,这是另一回事,但这只是一个警告,没什么大不了的。

它发生是因为 fsevents 是一个可选依赖项,仅在项目在 macOS 环境上运行时使用(该包提供“对 Mac OS-X FSEvents 的本机访问”)。

来源: npm WARN notsup 跳过可选依赖:fsevents@1.0.14 不受支持的平台

于 2019-05-12T14:57:15.093 回答