Angular2平滑升级到Angular4的步骤详解

链接: http://www.jb51.net/article/109792.htm 

升级过程

使用npm-check方案升级 使用如下命令检查,并按下空格来选择要升级的包

?

1

npm-check -u

官方推荐

升级cli

?

1

2

3

4

5

6

npm uninstall -g @angular/cli

npm cache clean

npm install -g @angular/cli@latest

 

rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell

npm install --save-dev @angular/cli@latest

升级包

?

1

2

3

4

// linux/mac

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

// Windows

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

更换一些其他包

?

1

npm install [email protected] --save

执行安装命令

?

1

npm install

你可能感兴趣的:(Angular2平滑升级到Angular4的步骤详解)