如何使用npm更新依赖关系的依赖关系

伊拉斯

我很好奇我找不到这个简单问题的答案。我也很纳闷这npm update不能解决这个问题。

我无法在此处发布完整的依赖关系树,但无论如何,请允许我描述我的问题:

minimist已过时(版本1.2.0),并且在此版本中存在安全漏洞。这些软件包要求最低要求将相关性定义为^ 1.2.0-因此它与1.2.2兼容。

常见的解决办法是把它放到package.jsondevDependenciesdependencies^1.2.2我不想把它放进去package.json我觉得npm update还应该更新间接依赖项。

我想念什么吗?

在这里您可以看到我的package-lock.json:https : //github.com/tflori/riki-community/blob/master/package-lock.json

和的输出npm ls minimist

riki-community@ /home/iras/work/projects/riki/community
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]  deduped
│ └─┬ [email protected]
│   └── [email protected] 
├─┬ [email protected]
│ └─┬ @jest/[email protected]
│   ├─┬ @jest/[email protected]
│   │ └─┬ @babel/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] 
│   └─┬ [email protected]
│     └─┬ [email protected]
│       ├─┬ @cnakazawa/[email protected]
│       │ └── [email protected]  deduped
│       └── [email protected]  deduped
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected] 
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]  deduped
└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └─┬ UNMET OPTIONAL DEPENDENCY [email protected]
        └─┬ UNMET OPTIONAL DEPENDENCY [email protected]
          ├─┬ UNMET OPTIONAL DEPENDENCY [email protected]
          │ └── UNMET OPTIONAL DEPENDENCY [email protected] 
          └─┬ UNMET OPTIONAL DEPENDENCY [email protected]
            └── UNMET OPTIONAL DEPENDENCY [email protected] 
伊拉斯

在其他人做之前:当然有解决方法...

打开package-lock.json找到所有出现"minimist": {的对象并删除该对象。

例:

更改此:

          "dependencies": {
            "minimist": {
              "version": "1.2.0",
              "bundled": true,
              "dev": true,
              "optional": true
            }
          }

对此:

          "dependencies": {
          }

npm install再次运行

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章