【问题标题】:Whenever I try to install npm packages these WARN messages show up每当我尝试安装 npm 软件包时,这些 WARN 消息都会出现
【发布时间】:2021-01-20 04:33:35
【问题描述】:
 1. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
 2. npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. 
 3. npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. 
 4. npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. 
 5. npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

我尝试了几个命令,例如 npm clean cache --force 和 npm install npm @latest 等。但是,这个问题还没有解决。

【问题讨论】:

    标签: node.js npm package


    【解决方案1】:

    这意味着你的依赖中的一些模块实际上依赖于这些过时的包。不幸的是,npm clean cache 无济于事。 要纠正这个问题,您首先需要分析 package-lock.json 文件 - 它包含您所涉及的所有模块的所有相互依赖关系树。然后,当您根据过时的模块找到所有模块时,您可能有 3 个选项:

    1. 查找具有类似功能且不依赖于过时模块的软件包
    2. 升级到较新的版本,希望依赖项也已升级
    3. 向作者发布问题(如果可能)以敦促他们删除过时的依赖项

    【讨论】:

      猜你喜欢
      • 2022-12-05
      • 2021-10-17
      • 1970-01-01
      • 2016-11-23
      • 1970-01-01
      • 2021-10-03
      • 2021-07-25
      • 2019-11-03
      • 2022-12-26
      相关资源
      最近更新 更多