比如安装protobufjs
1.查看最近版本view
$ npm view protobufjs
列出最近结果:
dist-tags:
latest: 6.10.1
next: 6.10.1-beta.0
2..安装指定版本install
$ npm install protobufjs@6.10.1 -g
结果:
andrew@DESKTOP-P49JS9I /cygdrive/e/study/game/egret/test_websocket
$ npm install protobufjs@6.10.1 -g
C:\Users\andrew\AppData\Roaming\npm\pbjs -> C:\Users\andrew\AppData\Roaming\npm\node_modules\protobufjs\bin\pbjs
C:\Users\andrew\AppData\Roaming\npm\pbts -> C:\Users\andrew\AppData\Roaming\npm\node_modules\protobufjs\bin\pbts
> protobufjs@6.10.1 postinstall C:\Users\andrew\AppData\Roaming\npm\node_modules\protobufjs
> node scripts/postinstall
+ protobufjs@6.10.1
added 14 packages from 46 contributors in 3.563s