npm `wanted` vs `latest`

后端 未结 3 1890
有刺的猬
有刺的猬 2020-12-04 23:08

I use npm to install some command line tools. Having the itch to always be up to date, I found the command npm -g outdated.

What is the dif

3条回答
  •  攒了一身酷
    2020-12-04 23:48

    Update:

    On my machine currently npm -g outdated shows:

    Package         Current  Wanted  Latest  Location
    babel-cli        6.1.18   6.2.0   6.2.0
    generator-rise    1.7.0   2.1.0   2.1.0
    npm               3.3.6   3.5.0   3.4.1
    

    The version 3.5.0 exists as a release on github but has not yet been published to npm. So it is somehow getting picked up from there but glossing over the npm source I couldn't find any evidence to support this argument.


    From the official documentation:

    The resulting field 'wanted' shows the latest version according to the version specified in the package.json, the field 'latest' the very latest version of the package.

    To elaborate:

    npm allows you to specify a range of versions in your package.json, examples are available here. The maximum version that can be accommodated in the specified range is the wanted column.

    This may be different from the version installed (if at all) because package.json may have changed in the meanwhile, or the author may have pushed a new minor release in between.

提交回复
热议问题