如何确定深度过时/弃用软件包(NPM)的路径? [英] How to determine path to deep outdated/deprecated packages (NPM)?
问题描述
如何确定在我的本地NPM安装中哪些软件包(深 - 依赖项,而不是顶级软件包)已过时?
How to determine, which packages (deep-dependencies, not top-level) are outdated in my local NPM installation?
I运行以下命令:
npm install
在我的 package.json
中有这个:
"dependencies": {
"bluebird": "^3.3.4",
"body-parser": "~1.15.0",
"connect-flash": "^0.1.1",
"cookie-parser": "~1.4.1",
"debug": "~2.2.0",
"express": "~4.13.1",
"express-session": "^1.13.0",
"hbs": "~4.0.0",
"lodash": "^4.6.1",
"mkdirp-bluebird": "^1.0.0",
"morgan": "~1.7.0",
"opener": "^1.4.1",
"sequelize": "^3.19.3",
"serve-favicon": "~2.3.0",
"sqlite3": "^3.1.1"
},
并获得以下输出:
$ npm install
npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
在我的 package.json
所有包都是新鲜,但一些深度依赖已经过时,我不知道,如何确定它们的 WHICH ..我想快速完成;)
In my package.json
all packages are fresh, but some of deep dependencies are outdated, and I don't know, how to determine WHICH of them.. And I want to do it quickly;)
推荐答案
你想......
npm install -g npm-check-updates
然后显示可用的更新
ncu
还...
ncu -u
实际上改变 package.json
以反映 ncu
的输出。
which actually change package.json
to reflect the output of ncu
.
如果这还不够......
And if that wasn't enough ...
ncu -m bower
检查新的凉亭套餐!
套餐 npm-check-updates
以及更多文档 是此处强>
Package npm-check-updates
and more documentation is here
npm-check-updates
不提供深度选项。通过进一步的研究,我发现npm 现在提供了一个CLI的能力,可以做你想做的事。
npm-check-updates
does not provide a depth option. With further research I found that npm now provides a CLI utitility to do what you want.
这基本上允许你做...
This essentially allows you to do ...
npm outdated --depth=5
提供类似的输出 npm-check-updates
但也会检查深度。
which provides a similar output to npm-check-updates
but also checks depth.
请注意默认深度为0,仅限顶级包。另请注意 npm过时
仅列出
Note the default depth is 0 viz top level packages only. Also note that npm outdated
only lists
- 当前版本
- 想要的版本
- 最新版本
它实际上并没有进行更新。
it does not actually do the update.
要更新套餐,请使用:
npm update --depth=5
npm警告不要将deep选项与 npm-update
这篇关于如何确定深度过时/弃用软件包(NPM)的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!