我爱编程

升级ionic3.9, 基于angular5.0,亲测通过

2017-12-04  本文已影响0人  DONG999

1. 首先确保angular已经是5.0 版本, cli应该是1.5.5

D:\workspaceM\ my_project >ng -v

_ _ ____ _ ___ / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _| / ? \ | '_ \ / _` | | | | |/ _` | '__| | | | | | | / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | | /_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___| |___/ Angular CLI: 1.5.5 Node: 6.10.1 OS: win32 x64 Angular: 5.0.1 ... common, compiler, compiler-cli, core, forms, http ... platform-browser, platform-browser-dynamic @angular/cli: 1.5.5 @angular-devkit/build-optimizer: 0.0.32 @angular-devkit/core: 0.0.22 @angular-devkit/schematics: 0.0.38 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.8.5 @schematics/angular: 0.1.8 typescript: 2.4.2 webpack: 3.6.0

2. 查看当前ionic

D:\workspaceM>ionic -v

3.19.0

3.开始升级

npm install ionic-angular@3.9.2 --save

4.更新旧project的package.json

"dependencies" : {

...

"@angular/common": "5.0.0",

"@angular/compiler": "5.0.0",

"@angular/compiler-cli": "5.0.0",

"@angular/core": "5.0.0",

"@angular/forms": "5.0.0",

"@angular/http": "5.0.0",

"@angular/platform-browser": "5.0.0",

"@angular/platform-browser-dynamic": "5.0.0",

"@ionic/storage": "2.1.3",

"ionic-angular": "3.9.0",

"rxjs": "5.5.2",

"zone.js": "0.8.18" ...

},

"devDependencies: {

"@ionic/app-scripts": "3.1.0",

"typescript" : "2.4.2"

}

5. 测试ionic serve

D:\workspaceM\my_project>ionic serve

Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser

上一篇下一篇

猜你喜欢

热点阅读