【问题标题】:Update version of deeply placed package深置包的更新版本
【发布时间】:2017-11-27 12:57:18
【问题描述】:

有一个小型 React/Redux 应用程序我想对照 nsp 检查进行检查。
例如,nsp 抱怨我在应用中使用的 debug 2.6.8 包包含漏洞。所以我需要升级 debug 的版本:

Regular Expression Denial of Service  
│ Name       │ debug  
│ CVSS       │ 3.7 (Low)  
│ Installed  │ 2.6.8  
│ Vulnerable │ <= 2.6.8 || >= 3.0.0 <= 3.0.1  
│ Patched    │ >= 2.6.9 < 3.0.0 || >= 3.1.0  
│ Path       │ sms-web@0.0.1 > webpack-dev-server@2.5.0 >  
 compression@1.7.0 >  
│            │ debug@2.6.8  
│ More Info  │ https://nodesecurity.io/advisories/534

我试过npm update --depth=7,但它没有更新调试包。
那么如何更新深层放置的包,例如调试?

【问题讨论】:

标签: reactjs npm npm-install


【解决方案1】:

根据文档:

从 npm@2.6.1 开始,npm update 将只检查顶级包。以前版本的 npm 也会递归地检查所有依赖项。要获得旧行为,请使用 npm --depth 9999 update。为了只更新你可以做的调试包

npm --depth 9999 update debug

或者你可以像这样卸载并重新安装它

npm uninstall -S debug 
npm install -S debug 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-22
    • 2015-03-29
    • 2016-04-10
    • 2019-01-11
    • 2016-07-12
    • 2019-12-21
    • 1970-01-01
    • 2019-04-15
    相关资源
    最近更新 更多