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

查看:33
本文介绍了如何安装旧版本的 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 它不起作用.

推荐答案

你应该使用 angular 4.它现在是一个发布版本,并且是测试版.

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天全站免登陆