npm outdated

检查哪些依赖包有可用更新

语法

npm outdated [<package>] [--global]

参数

参数说明示例级别
(无参数) 检查所有依赖的更新 npm outdated 常用
<package> 检查指定包 npm outdated react 常用
-g --global 检查全局包 npm outdated -g 常用
--long 显示详细信息 npm outdated --long 进阶

示例

查看所有可更新的包

npm outdated
Current=当前版本, Wanted=范围内最新, Latest=绝对最新

检查全局包更新

npm outdated -g

JSON 格式输出

npm outdated --json
适合脚本处理

常见错误

输出为空 所有依赖都是最新的,或者没有安装依赖

技巧

相关命令