yarn outdated

npm install yarn -g

检查过时的包依赖。

yarn outdated

列出包的所有依赖项的版本信息,包括当前已安装的版本、最符合语义版本定义(semver)的版本和最新的可用版本。

例如,package.json 中列出了以下依赖项:


{
  "dependencies": {
    "underscore": "~1.6.0"
  },
  "devDependencies": {
    "lodash": "4.15.0"
  }
}

命令的输出结果类似以下︰

yarn outdated
Package    Current Wanted Latest Package Type    URL
lodash     4.15.0  4.15.0 4.16.4 devDependencies https://github.com/lodash/lodash#readme
underscore 1.6.0   1.6.0  1.8.3  dependencies    https://github.com/jashkenas/underscore#readme
✨  Done in 0.72s.
yarn outdated [package...]

列出一个或多个依赖项的版本信息。

例如,对于上述 package.json文件,当检查一个依赖包的版本信息时,会有以下输出:

yarn outdated lodash
Package Current Wanted Latest Package Type    URL
lodash  4.15.0  4.15.0 4.16.4 devDependencies https://github.com/lodash/lodash#readme
✨  Done in 1.04s.