node.js 如何通过 npm 安装特定版本的 ionic
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30316994/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install specific version of ionic via npm
提问by fedmich
What command do I need to run to install specific version via npm?
我需要运行什么命令才能通过 npm 安装特定版本?
If I run the code npm install -g cordovait installs the latest version. Since I'm using multiple laptops and computers I need them to have same versions when I switch back and forth to them.
如果我运行代码npm install -g cordova它会安装最新版本。由于我使用多台笔记本电脑和计算机,因此当我来回切换时,我需要它们具有相同的版本。
This is the version of IONIC I am using and preferred: I'd like to avoid and updatethem all as I may encounter bugs if I use the latest version.
这是我正在使用和首选的 IONIC 版本:我想避免并更新它们,因为如果我使用最新版本,我可能会遇到错误。
Ionic CLI is out of date:
Locally installed version: 1.3.20
* Latest version: 1.4.3
* https://github.com/driftyco/ionic-cli/blob/master/CHANGELOG.md
* Run npm install -g ionic to update
btw, I found these releases via github https://github.com/driftyco/ionic-cli/releases
顺便说一句,我通过 github https://github.com/driftyco/ionic-cli/releases找到了这些版本
Thanks in advance for the help!
在此先感谢您的帮助!
回答by Aki Nishanov
Syntax
句法
To install a specific versionthrough npm, the following syntaxshould be followed:
要通过npm安装特定版本,应遵循以下语法:
npm install -g ionic@VERSION
- Where
VERSIONis the number of the versionwe want to installfromIonic
- 当
VERSION是的版本号,我们要安装从Ionic
Example
例子
Let's say that we want to install IONIC 1.4.0, because you should specify:
假设我们要安装IONIC 1.4.0,因为您应该指定:
npm install -g [email protected]
Notes
To see all available versions use:
npm info ionic.
笔记
要查看所有可用版本,请使用:
npm info ionic.
回答by Marcelo Agimóvel
Linux:
Linux:
sudo npm install -g [email protected]
Mac
苹果电脑
npm install -g [email protected]
Replace 2.2.0 for the version you want
将 2.2.0 替换为您想要的版本
回答by Pinky
For example you want install 3.2.0 of ionic version then you need to install it by using below command.
例如你想安装 3.2.0 的 ionic 版本,那么你需要使用下面的命令来安装它。
npm install [email protected] --save
npm install [email protected] --save
If you want to install the latest version of ionic ,but already if you have the old one then use
如果你想安装最新版本的 ionic ,但如果你已经有了旧版本,那么使用
npm install ionic@latest --save
npm 安装 ionic@latest --save
回答by Piotr Fryga
In addition you can update your package.json file
此外,您可以更新 package.json 文件
e.g.
例如
"dependencies": {
"ionic": "^1.4.3"
}
Where 1.4.3is ionic version.
1.4.3离子版在哪里。

