2017-04-15 113 views
0

我对angular2软件包感兴趣。 我正在运行@ angular/common @ 4.0.2。如何使用角度为4的角度2包?

当我尝试安装它,这是我的消息:

peerinvalid Peer [email protected] wants @angular/[email protected]^2.0.0 

我可以降级我的角度,以2

但我认为角2和4或Angular.io或角总之所有兼容和相同的架构?

我怎样才能使用这个角度2兼容包4?

+4

您是否尝试过无视故宫,只是给它一个去? – jonrsharpe

+0

我没有绕过npm呢。那你怎么忽略npm呢? –

+3

你只是......忽略它。您不需要“绕过”它,只需继续编写软件而不需要注意。 – jonrsharpe

回答

0

更新到4就像更新您的Angular依赖关系到最新版本一样简单,并且双重检查您是否需要动画。这对大多数用例都有效。

在Linux/Mac上:

npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@latest [email protected] --save 

在Windows上:

npm install @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] [email protected] --save