# Upgrade to Angular 5

**URL:** <https://forum.ionicframework.com/t/upgrade-to-angular-5/113110>\
**Category:** ionic-v3\
**Created:** [November 23, 2017, 8:48am UTC](https://forum.ionicframework.com/t/upgrade-to-angular-5/113110 "2017-11-23T08:48:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![codiqa10004205](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/codiqa10004205/32/110819_2.png) [@codiqa10004205](https://forum.ionicframework.com/u/codiqa10004205)\
**Post date:** [November 23, 2017, 8:48am UTC](https://forum.ionicframework.com/t/upgrade-to-angular-5/113110/1 "2017-11-23T08:48:58Z")

</div>

Going over suggestion following the latest upgrade instructions in the change log here. I got stuck and now the ionic project doesn’t compile at all.  
I am using translate and stuck with OpaqueToken problem.  
How should I change the translate implementation to use it?

Error  
Close  
Typescript Error  
Module ‘“C:/Users/2bher/WebstormProjects/ionic3-angular4\_2/node\_modules/@angular/http/src/http”’ has no exported member ‘Http’.  
…bstormProjects/ionic3-angular4\_2/node\_modules/@angular/http/src/http\_module.d.ts  
import { RequestOptions } from ‘./base\_request\_options’;  
import { Http, Jsonp } from ‘./http’;  
export declare function \_createDefaultCookieXSRFStrategy(): CookieXSRFStrategy;  
Typescript Error  
Module ‘“C:/Users/2bher/WebstormProjects/ionic3-angular4\_2/node\_modules/@angular/http/src/http\_module”’ has no exported member ‘HttpClientModule’.  
…her/WebstormProjects/ionic3-angular4\_2/node\_modules/@angular/http/src/index.d.ts  
undefined  
Typescript Error  
Module ‘“C:/Users/2bher/WebstormProjects/ionic3-angular4\_2/node\_modules/@angular/core/core”’ has no exported member ‘OpaqueToken’.  
…ts/ionic3-angular4\_2/node\_modules/@ngx-translate/core/src/translate.service.d.ts  
import { EventEmitter, OpaqueToken } from “@angular/core”;  
import { Observable } from “rxjs/Observable”;  
Typescript Error  
Class ‘Subject’ incorrectly extends base class ‘Observable’. Types of property ‘lift’ are incompatible. Type ‘(operator: Operator\<T, R\>) =\> Observable’ is not assignable to type ‘(operator: Operator\<T, R\>) =\> Observable’. Type ‘Observable’ is not assignable to type ‘Observable’. Type ‘T’ is not assignable to type ‘R’.  
…jects/ionic3-angular4\_2/node\_modules/ionic-native/node\_modules/rxjs/Subject.d.ts  
\*/  
export declare class Subject extends Observable implements ISubscription {  
observers: Observer[];  
Typescript Error  
Class ‘WebSocketSubject’ incorrectly extends base class ‘AnonymousSubject’. Types of property ‘lift’ are incompatible. Type ‘(operator: Operator\<T, R\>) =\> WebSocketSubject’ is not assignable to type ‘(operator: Operator\<T, R\>) =\> Observable’. Type ‘WebSocketSubject’ is not assignable to type ‘Observable’. Types of property ‘operator’ are incompatible. Type ‘Operator\<any, R\>’ is not assignable to type ‘Operator\<any, T\>’. Type ‘R’ is not assignable to type ‘T’.  
…node\_modules/ionic-native/node\_modules/rxjs/observable/dom/WebSocketSubject.d.ts  
\*/  
export declare class WebSocketSubject extends AnonymousSubject {  
url: string;  
Typescript Error  
Argument of type ‘{ location: boolean; }’ is not assignable to parameter of type ‘NavOptions’. Object literal may only specify known properties, and ‘location’ does not exist in type ‘NavOptions’.  
…/WebstormProjects/ionic3-angular4\_2/src/pages/location-select/location-select.ts  
close(){  
this.navCtrl.popTo(TutorialPage, {location: false});  
}  
Ionic Framework: ^3.9.2  
Ionic Native: ^2.9.0  
Ionic App Scripts: 3.1.2  
Angular Core: ^5.0.0  
Angular Compiler CLI: ^5.0.0  
Node: 8.9.1  
OS Platform: Windows 10  
Navigator Platform: Win32  
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

package.json  
{  
“name”: “wise-app”,  
“version”: “0.0.1”,  
“author”: “Tzvi Gregory Kaidanov”,  
“homepage”: “[http://wisea-app.biz](http://wisea-app.biz)”,  
“private”: true,  
“scripts”: {  
“clean”: “ionic-app-scripts clean”,  
“build”: “ionic-app-scripts build”,  
“lint”: “ionic-app-scripts lint”,  
“ionic:build”: “ionic-app-scripts build”,  
“ionic:serve”: “ionic-app-scripts serve”  
},  
“dependencies”: {  
"@angular/animations": “^5.0.0”,  
"@angular/common": “^5.0.0”,  
"@angular/compiler": “^5.0.0”,  
"@angular/compiler-cli": “^5.0.0”,  
"@angular/core": “^5.0.0”,  
"@angular/flex-layout": “^2.0.0-beta.10-4905443”,  
"@angular/forms": “^5.0.0”,  
"@angular/http": “^5.0.0”,  
"@angular/platform-browser": “^5.0.0”,  
"@angular/platform-browser-dynamic": “^5.0.0”,  
"@angular/platform-server": “^5.0.0”,  
"@angular/router": “^5.0.0”,  
"@ionic-native/camera": “^4.3.2”,  
"@ionic-native/core": “^4.2.0”,  
"@ionic-native/device": “^4.0.0”,  
"@ionic-native/geolocation": “^4.4.2”,  
"@ionic-native/google-maps": “^4.4.2”,  
"@ionic-native/in-app-browser": “^4.3.2”,  
"@ionic-native/native-storage": “^4.0.0”,  
"@ionic-native/network": “^4.2.1”,  
"@ionic-native/splash-screen": “4.3.2”,  
"@ionic-native/status-bar": “4.3.2”,  
"@ionic/storage": “2.1.3”,  
"@ngx-translate/core": “6.0.1”,  
"@ngx-translate/http-loader": “0.0.3”,  
"@types/google-maps": “^3.2.0”,  
“chart.js”: “^2.7.1”,  
“copyfiles”: “^1.2.0”,  
“cordova-android”: “6.3.0”,  
“cordova-browser”: “5.0.1”,  
“cordova-plugin-add-swift-support”: “^1.7.0”,  
“cordova-plugin-camera”: “git+https://github.com/apache/cordova-plugin-camera.git”,  
“cordova-plugin-compat”: “^1.2.0”,  
“cordova-plugin-device”: “^1.1.4”,  
“cordova-plugin-facebook4”: “^1.9.1”,  
“cordova-plugin-geolocation”: “^3.0.0”,  
“cordova-plugin-googlemaps”: “^2.1.1”,  
“cordova-plugin-ionic”: “^2.0.3”,  
“cordova-plugin-splashscreen”: “^4.0.3”,  
“cordova-plugin-statusbar”: “^2.2.2”,  
“cordova-plugin-whitelist”: “^1.3.3”,  
“cordova-windows”: “^5.0.0”,  
“es6-promise-plugin”: “^4.1.0”,  
“font-awesome”: “^4.7.0”,  
“ionic-angular”: “^3.9.2”,  
“ionic-native”: “^2.9.0”,  
“ionic-plugin-keyboard”: “^2.2.1”,  
“ionicons”: “3.0.0”,  
“reflect-metadata”: “^0.1.10”,  
“rxjs”: “^5.5.2”,  
“sw-toolbox”: “3.6.0”,  
“zone.js”: “0.8.18”  
},  
“devDependencies”: {  
"@ionic/app-scripts": “3.1.2”,  
"@types/googlemaps": “^3.26.20”,  
“typescript”: “^2.4.2”  
},  
“description”: “WiseApp try in on!”,  
“cordova”: {  
“plugins”: {  
“cordova-plugin-console”: {},  
“cordova-plugin-device”: {},  
“cordova-plugin-statusbar”: {},  
“ionic-plugin-keyboard”: {},  
“cordova-plugin-facebook4”: {  
“APP\_ID”: "  
},  
“cordova-plugin-splashscreen”: {},  
“cordova-plugin-ionic”: {  
“APP\_ID”: “7cf28f17”,  
“CHANNEL\_NAME”: “Master”,  
“UPDATE\_METHOD”: “background”,  
“UPDATE\_API”: “[https://api.ionicjs.com](https://api.ionicjs.com)”,  
“MAX\_STORE”: “2”  
},  
“cordova-plugin-compat”: {},  
“cordova-plugin-camera”: {},  
“cordova-plugin-whitelist”: {},  
“cordova-plugin-geolocation”: {},  
“cordova-plugin-googlemaps”: {  
“API\_KEY\_FOR\_ANDROID”:  
}  
},  
“platforms”: []  
},  
“config”: {  
“ionic\_bundler”: “webpack”,  
“ionic\_source\_map”: “source-map”,  
“ionic\_copy”: “./scripts/copy-custom-libs.js”  
}  
}

TSCONFIG\>json

{  
“compilerOptions”: {  
“allowSyntheticDefaultImports”: true,  
“declaration”: false,  
“emitDecoratorMetadata”: true,  
“experimentalDecorators”: true,  
“lib”: [  
“dom”,  
“es2017”  
],  
“moduleResolution”: “node”,  
“sourceMap”: true,  
“target”: “es5”,  
“typeRoots”: [“node\_modules/@types”],  
“baseUrl”: “src”  
},  
“include”: [  
“src/\*\*/\*.ts”  
],  
“exclude”: [  
“node\_modules”  
],  
“compileOnSave”: false,  
“atom”: {  
“rewriteTsconfig”: false  
},  
“angularCompilerOptions”: {  
“preserveWhitespaces”: false  
}  
}

What else should i change?

I used this [https://angular-update-guide.firebaseapp.com/](https://angular-update-guide.firebaseapp.com/)  
by this blog [https://alligator.io/angular/angular-5/](https://alligator.io/angular/angular-5/)

Any ideas?

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [November 23, 2017, 9:10am UTC](https://forum.ionicframework.com/t/upgrade-to-angular-5/113110/2 "2017-11-23T09:10:16Z")

</div>

Read the Ionic changelog to upgrade Ionic. Don’t upgrade Angular or Typescript outside of that, because Ionic’s dependencies run behind the most recent Angular and TS versions, so you might be introducing an inconsistency without realizing it.

Your upgrade is suspicious, because your Ionic Native is so old, even though your package.json claims it is much newer. That might be an issue with several packages.

You might need to nuke node\_modules, and then follow the directions in the Ionic changelog.

---

<div class="post-metadata">

**Author:** ![codiqa10004205](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/codiqa10004205/32/110819_2.png) [@codiqa10004205](https://forum.ionicframework.com/u/codiqa10004205)\
**Post date:** [November 23, 2017, 1:40pm UTC](https://forum.ionicframework.com/t/upgrade-to-angular-5/113110/3 "2017-11-23T13:40:25Z")

</div>

> [@AaronSterling](#):
>
> on’t upgrade Angular or Typescript outside of that, because Ionic’s dependencies run behind the most recent Angular and TS versions, so you might be introducing an inconsistency without realizing it.
> 
> Your upgrade is suspicious, because your Ionic Native is so old, even though your package.json claims it is much newer. That might be an issue with several packages.

I have rebuilt all my project from ionic starter of tabs

package.json

{  
“name”: “wiseapp”,  
“version”: “0.0.1”,  
“author”: “Ionic Framework”,  
“homepage”: “[http://ionicframework.com/](http://ionicframework.com/)”,  
“private”: true,  
“scripts”: {  
“clean”: “ionic-app-scripts clean”,  
“build”: “ionic-app-scripts build”,  
“lint”: “ionic-app-scripts lint”,  
“ionic:build”: “ionic-app-scripts build”,  
“ionic:serve”: “ionic-app-scripts serve”  
},  
“dependencies”: {  
“@angular/common”: “5.0.1”,  
“@angular/compiler”: “5.0.1”,  
“@angular/compiler-cli”: “5.0.1”,  
“@angular/core”: “5.0.1”,  
“@angular/forms”: “5.0.1”,  
“@angular/http”: “5.0.1”,  
“@angular/platform-browser”: “5.0.1”,  
“@angular/platform-browser-dynamic”: “5.0.1”,  
“@ionic-native/camera”: “^4.4.2”,  
“@ionic-native/core”: “4.4.0”,  
“@ionic-native/geolocation”: “^4.4.2”,  
“@ionic-native/network”: “^4.4.2”,  
“@ionic-native/splash-screen”: “4.4.0”,  
“@ionic-native/status-bar”: “4.4.0”,  
“@ionic/pro”: “1.0.16”,  
“@ionic/storage”: “2.1.3”,  
“@ngx-translate/core”: “^8.0.0”,  
“@ngx-translate/http-loader”: “^2.0.0”,  
“chart.js”: “^2.7.1”,  
“cordova-android”: “6.3.0”,  
“cordova-plugin-camera”: “^3.0.0”,  
“cordova-plugin-device”: “^1.1.4”,  
“cordova-plugin-geolocation”: “^3.0.0”,  
“cordova-plugin-ionic-webview”: “^1.1.16”,  
“cordova-plugin-network-information”: “^1.3.4”,  
“cordova-plugin-splashscreen”: “^4.0.3”,  
“cordova-plugin-whitelist”: “^1.3.1”,  
“ionic-angular”: “3.9.2”,  
“ionic-native”: “^2.9.0”,  
“ionic-plugin-keyboard”: “^2.2.1”,  
“ionicons”: “3.0.0”,  
“rxjs”: “5.5.2”,  
“sw-toolbox”: “3.6.0”,  
“zone.js”: “0.8.18”  
},  
“devDependencies”: {  
“@ionic/app-scripts”: “3.1.2”,  
“typescript”: “2.4.2”  
},  
“description”: “An Ionic project”,  
“cordova”: {  
“plugins”: {  
“cordova-plugin-geolocation”: {  
“GEOLOCATION\_USAGE\_DESCRIPTION”: “Wiseapp customer loaction”  
},  
“cordova-plugin-network-information”: {},  
“cordova-plugin-camera”: {},  
“ionic-plugin-keyboard”: {},  
“cordova-plugin-whitelist”: {},  
“cordova-plugin-device”: {},  
“cordova-plugin-splashscreen”: {},  
“cordova-plugin-ionic-webview”: {}  
},  
“platforms”: [  
“android”  
]  
}  
}

tsconfig.json  
{  
“compilerOptions”: {  
“noStrictGenericChecks”: true,  
“allowSyntheticDefaultImports”: true,  
“declaration”: false,  
“emitDecoratorMetadata”: true,  
“experimentalDecorators”: true,  
“lib”: [  
“dom”,  
“es2015”  
],  
“module”: “es2015”,  
“moduleResolution”: “node”,  
“sourceMap”: true,  
“target”: “es5”,  
“typeRoots”: [  
“…/node\_modules/@types”  
]  
},  
“include”: [  
“src/**/\*.ts"  
],  
“exclude”: [  
“node\_modules”,  
"src/**/_.spec.ts",  
"src/\*\*/ **tests** /_.ts”  
],  
“compileOnSave”: false,  
“atom”: {  
“rewriteTsconfig”: false  
}  
}

tweaked to work with httpCLient and changed rest api

now I am stuck on geolocation and camera

getting

```auto
**core.js:1350 ERROR Error: Uncaught (in promise): Error: StaticInjectorError[Geolocation]:**
**StaticInjectorError[Geolocation]:**
 **NullInjectorError: No provider for Geolocation!**

```

WIth camera similar…

Any ideas how to solve it?

By the way the data on other pages works… so it’s just about several plugins now…

---

<div class="post-metadata">

**Author:** ![mfouash](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mfouash/32/112535_2.png) [@mfouash](https://forum.ionicframework.com/u/mfouash)\
**Post date:** [February 6, 2018, 12:01pm UTC](https://forum.ionicframework.com/t/upgrade-to-angular-5/113110/4 "2018-02-06T12:01:36Z")

</div>

same problem with me ☹

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 10:02pm UTC](https://forum.ionicframework.com/t/upgrade-to-angular-5/113110/5 "2021-07-19T22:02:24Z")

</div>

Closed on July 19, 2021, 10:02pm UTC


