无法将现有的Angular Cli项目升级到Angular 4 Rc1 [英] Cannot Upgrade a Existing Angular Cli project to Angular 4 Rc1

查看:67
本文介绍了无法将现有的Angular Cli项目升级到Angular 4 Rc1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下命令升级到Angular 4 Rc1

I am trying to use the following command to upgrade to Angular 4 Rc1

npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@next --save

这是可以转换为角度4的命令

This is the command that is suppose to work to convert to angular 4

https://github.com/angular/angular/blob/master/CHANGELOG.md

但是这个命令给我一个错误

But this Command is giving me a error

E:\Softwares\Angular2\Angular2Concepts>npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@ne
xt --save
npm ERR! addLocal Could not install E:\Softwares\Angular2\Angular2Concepts\@angular\{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-serv
er,router,animations}@next
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "@angular/{common,compiler,compiler-cli,core,forms,http,pla
tform-browser,platform-browser-dynamic,platform-server,router,animations}@next" "--save"
npm ERR! node v7.2.1
npm ERR! npm  v3.10.10
npm ERR! path E:\Softwares\Angular2\Angular2Concepts\@angular\{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@
next
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open 'E:\Softwares\Angular2\Angular2Concepts\@angular\{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-
dynamic,platform-server,router,animations}@next'
npm ERR! enoent ENOENT: no such file or directory, open 'E:\Softwares\Angular2\Angular2Concepts\@angular\{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-
dynamic,platform-server,router,animations}@next'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     E:\Softwares\Angular2\Angular2Concepts\npm-debug.log

推荐答案

如果此命令不起作用

npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@next --save

然后像这样单独尝试-

npm install @angular/common@next --save
npm install @angular/compiler@next --save
npm install @angular/compiler-cli@next --save
npm install @angular/core@next --save
npm install @angular/forms@next --save
npm install @angular/http@next --save
npm install @angular/platform-browser@next --save
npm install @angular/platform-browser-dynamic@next --save
npm install @angular/platform-server@next --save
npm install @angular/router@next --save
npm install @angular/animations@next --save

分别运行命令对我有帮助,现在 package.json 中的依赖项看起来像这样-

Running commands individually helps for me and now dependencies in package.json looks like this-

"@angular/animations": "^4.0.0-rc.1",
"@angular/common": "^4.0.0-rc.1",
"@angular/compiler": "^4.0.0-rc.1",
"@angular/compiler-cli": "^4.0.0-rc.1",
"@angular/core": "^4.0.0-rc.1",
"@angular/forms": "^4.0.0-rc.1",
"@angular/http": "^4.0.0-rc.1",
"@angular/platform-browser": "^4.0.0-rc.1",
"@angular/platform-browser-dynamic": "^4.0.0-rc.1",
"@angular/platform-server": "^4.0.0-rc.1",
"@angular/router": "^4.0.0-rc.1", 

请记住,您需要打字稿":"^ 2.1.6",

这篇关于无法将现有的Angular Cli项目升级到Angular 4 Rc1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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