How to update / upgrade from Angular 4 to Angular 5+

前端 未结 6 1380
长情又很酷
长情又很酷 2020-12-01 00:11

I need to update my project from Angular 4 to Angular 5+ ,

I need to change all following dependencies to Angular 5+.

I also updated Angular CLI to 1.5.0.

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 00:47

    Problem fixed with Node version update.

    I had to update Node version,

    sudo apt-get install nodejs
    
    npm uninstall -g @angular/cli
    
    npm cache clean
    
    npm install -g @angular/cli@latest
    
    ng new ProjectName
    

    node --version ==> 8.9.0

    ng --version ==> 1.5.0

    "dependencies": {
        "@angular/animations": "^5.0.0",
        "@angular/common": "^5.0.0",
        "@angular/compiler": "^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",
        "@angular/router": "^5.0.0",
        "rxjs": "^5.5.2",
        "zone.js": "^0.8.14"
    }
    

提交回复
热议问题