如何确定哪些软件包(深度依赖,而不是顶级)在我的本地NPM安装中已过时?
我运行以下命令:
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中,所有包都是新鲜的,但是一些深度依赖已经过时了,我不知道,如何确定它们中的哪一个..而且我想快速完成;)
解决方法
你要 …
npm install -g npm-check-updates
然后显示可用的更新
ncu
还……
ncu -u
这实际上改变了package.json以反映ncu的输出.
如果这还不够……
ncu -m bower
检查新的凉亭包!
包npm-check-updates和更多文档is here
编辑DEEP依赖项
npm-check-updates不提供深度选项.通过进一步的研究,我发现npm now provides是一个能够做你想做的事情的CLI.
这基本上允许你做…
npm outdated --depth=5
它提供与npm-check-updates类似的输出,但也检查深度.
请注意,默认深度仅为0 viz顶级包.另请注意,npm只有过时的列表
>当前版本
>想要的版本
>最新版本
它实际上并没有进行更新.
要更新包使用:
npm update --depth=5
npm警告不要将深度选项与npm-update结合使用