fef*_*rei 5 node.js npm npm-update
如何(递归)使用 NPM 更新所有依赖项?
\n\n我通常的方法(使用npm-check-updates
)是这样的:
ncu -u # updates my package.json to contain the newest versions of my dependencies\nnpm install # installs what ncu has written to package.json\nnpm update --depth 99999 # recursively updates packages to the newest version within the specified range\n
Run Code Online (Sandbox Code Playgroud)\n\n然而,这不起作用,并且经常使依赖项处于npm audit
抱怨子依赖项的状态。(或者,更糟糕的是,npm update --depth 99999
有时会挂起。)
跑步npm audit fix
会更新更多包,但只是为了修复安全漏洞。
我发现的唯一真正的解决方案是:
\n\nrm -rf package-lock.json node_modules # remove any trace of the old packages\nnpm install # start fresh\n
Run Code Online (Sandbox Code Playgroud)\n\n\xe2\x80\xa6但这不可能是正确的解决方案,对吧?正确的?
\n\n我很惊讶我必须在这里问这个问题,但是阅读文档并在互联网上搜索一段时间才得到结果,npm update --depth 99999
并且npm-check-updates
包,但它并不能完全完成工作。
归档时间: |
|
查看次数: |
872 次 |
最近记录: |