我最近使用 ng update
更新了我的 Angular 版本
并且在运行 npm audit
时,它发现了 1 个高严重性漏洞,但没有提供有关如何解决它的建议。它通常建议从 package.json 升级一个包,例如:“angular-devkit/build-angular”,但我已经在使用他们的最新版本。
=== npm audit security report ===
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://npmjs.com/advisories/803
found 1 high severity vulnerability in 29707 scanned packages
1 vulnerability requires manual review. See the full report for details.
我想安装 npm i tar
但我不确定。
最佳答案
以下内容对我有用:
转到 node_modules > node_gyp > package.json,然后在依赖项下找到 tar 并将 2.0.0 替换为 4.4.8。
然后运行:
- npm 我
- npm 审核
- npm 审计修复
- npm 审核
您应该看到 0 个漏洞。
我更新了一些 Angular 项目,每个项目都有相同的问题。做上述工作一直有效。
关于node.js - npm audit 任意文件覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55635378/