How am I supposed to find out what is the latest stable version of an npm package?

前端 未结 2 815
面向向阳花
面向向阳花 2021-02-05 15:44

Other than going to http://search.npmjs.org and search for it?

I usually need the version to put it in my package.json.

2条回答
  •  清歌不尽
    2021-02-05 16:31

    Use npm view [package-name] dist-tags in the command line.

    Example:

    $ npm view express dist-tags
    
    { latest: '2.5.9',
      '3.0': '3.0.0beta2' }
    

提交回复
热议问题