官术网_书友最值得收藏!

  • Node.js Web Development
  • David Herron
  • 135字
  • 2021-06-25 21:54:06

Installing a package by version number

Version number matching in npm is powerful and flexible. The same sort of version specifiers used in package.json dependencies can also be used with the npm install command:

$ npm install package-name@tag
$ npm install package-name@version
$ npm install package-name@version-range

The last two are what they sound like. You can specify express@4.16.2 to target a precise version, or express@">4.1.0 < 5.0" to  target a range of Express V4 versions.

The version match specifiers include these choices:

  • Exact version match: 1.2.3
  • At least version N: >1.2.3
  • Up to version N: <1.2.3
  • Between two releases: >=1.2.3 <1.3.0

The @tag attribute is a symbolic name such as @latest@stable, or @canary. The package owner assigns these symbolic names to specific version numbers, and can reassign them as desired. The exception is @latest, which is updated whenever a new release of the package is published.

For more documentation, run these commands: npm help json and npm help npm-dist-tag.

主站蜘蛛池模板: 天门市| 博白县| 灯塔市| 当阳市| 郓城县| 安达市| 科技| 东平县| 老河口市| 崇仁县| 衡水市| 旬阳县| 宜春市| 牙克石市| 琼结县| 浦江县| 潼关县| 通榆县| 喀什市| 东乡县| 鄂州市| 梧州市| 沙河市| 虞城县| 延庆县| 梨树县| 高安市| 宜黄县| 通城县| 常德市| 郑州市| 通城县| 墨脱县| 湛江市| 溆浦县| 静安区| 汉寿县| 临朐县| 盐源县| 甘泉县| 固安县|