Nodejs tips: npm Installing a specific version of a package, NPM安装特定版本包

First, find the version of the package(handlebars etc.)

首先, 先看看这个包有哪些发布版本(这里以handlebars为例)

$ npm view handlebars versions

OUTPUT:

npm http GET https://registry.npmjs.org/handlebars
npm http 304 https://registry.npmjs.org/handlebars

[ '1.0.2-beta',
  '1.0.4-beta',
  '1.0.5-beta',
  '1.0.6-2',
  '1.0.6',
  '1.0.7',
  '1.0.8',
  '1.0.9',
  '1.0.10',
  '1.0.11',
  '1.0.12',
  '1.1.0',
  '1.1.1',
  '1.1.2',
  '1.2.0',
  '1.2.1',
  '1.3.0',
  '2.0.0-alpha.1',
  '2.0.0-alpha.2',
  '2.0.0-alpha.3',
  '2.0.0-alpha.4' ]

install the 1.3.0 version.

安装1.3.0版本.

npm install handlebars@1.3.0 -g

OUTPUT:

npm http GET https://registry.npmjs.org/handlebars
npm http 304 https://registry.npmjs.org/handlebars
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/uglify-js
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/uglify-js
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/source-map
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/source-map
npm http GET https://registry.npmjs.org/amdefine
npm http 304 https://registry.npmjs.org/amdefine
This entry was posted in Useful Tips and tagged , . Bookmark the permalink.

Leave a Reply