• yarn outdated
  • yarn outdated [package…]

    检查过时的包依赖。

    yarn outdated

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

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

    1. {
    2. "dependencies": {
    3. "underscore": "~1.6.0"
    4. },
    5. "devDependencies": {
    6. "lodash": "4.15.0"
    7. }
    8. }

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

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

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

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

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

    原文: https://yarnpkg.com/zh-Hans/docs/cli/outdated