如何安装较旧版本的Angular? [英] How to install an older version of Angular?

查看:295
本文介绍了如何安装较旧版本的Angular?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装Angular 2,但是当我运行$ ng new myApp时,版本是4.我进行了很多搜索,但找不到唯一安装版本2的方法.

I need to install Angular 2 but when I'm run $ ng new myApp the version is 4. I searched a lot, but I could not find a way to install only version 2.

有人知道怎么做吗?

修改 命令: ng new MYAPP --ng4=false它不起作用.

Edit the command: ng new MYAPP --ng4=false It does not work.

推荐答案

您应该使用angular4.它现在是发行版本,不包含beta.

You should use angular 4. it's in a release version now and out of beta.

请查看ng new的选项: https://github.com/angular/angular-cli/wiki/new

如果您使用的是早于1.0.0的angular cli版本,请使用ng new myApp --ng4=false,将--ng4=false设置为默认值.

If you are on angular cli version earlier that 1.0.0 please use ng new myApp --ng4=false with that --ng4=false being the default anyway.

如果您使用的是1.0.0版,则无法将"angular 2"设置为默认值.请查看1.0.0 发行说明.在1.0.0版中,cli已更新为在生成新项目时仅使用angular 4.但是,您可以在生成的package.json中手动手动将角度版本更改为所需版本.

If you are using version 1.0.0 You cannot make angular 2 the default. please look at 1.0.0 release notes. In version 1.0.0 The cli was updated to use only angular 4 with generating new project. however, you can change the angular version manually in the generated package.json to the desired version.

这篇关于如何安装较旧版本的Angular?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆