Ionic angularfire2 InjectionToken error

typescript: node_modules/angularfire2/angularfire2.d.ts, line: 3

member ‘InjectionToken’

Any idea about this???

Thanks!!!

Are you running Angular 4?

Yes

Get Outlook for iOShttps://aka.ms/o0ukef

What did you install or change since it last worked?
What is the code running?

Also post your ionic info output please.

I have migrated ionic 2 to ionic 3 and install from angularfire2 beta 5 to angularfire2 4.0.0rc0

@angular2/core seems to be lacking InjectaToken module!!!

Get Outlook for iOShttps://aka.ms/o0ukef

package.json is important too. InjectionToken was introduced in Angular 4.

2 Likes

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1 
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.4
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.2.3 ios 4.4.0
Ionic Framework                 : ionic-angular 2.3.0

System:

Node       : v7.6.0
OS         : Linux 4.4
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.4

“dependencies”: {
"@angular/cli": “1.2.0”,
"@angular/common": “4.2.5”,
"@angular/compiler": “4.2.5”,
"@angular/compiler-cli": “4.2.5”,
"@angular/core": “4.2.5”,
"@angular/forms": “4.2.5”,
"@angular/http": “4.2.5”,
"@angular/platform-browser": “4.2.5”,
"@angular/platform-browser-dynamic": “4.2.5”,
"@angular/platform-server": “4.2.5”,
"@angular/router": “4.2.5”,
"@ionic-native/badge": “^3.5.0”,
"@ionic-native/camera": “^3.13.0”,
"@ionic-native/core": “^3.5.0”,
"@ionic-native/device": “^3.13.0”,
"@ionic-native/in-app-browser": “^3.13.0”,
"@ionic-native/mixpanel": “^3.12.1”,
"@ionic-native/social-sharing": “^3.13.0”,
"@ionic-native/splash-screen": “^3.13.0”,
"@ionic-native/status-bar": “^3.13.0”,
"@ionic/cloud-angular": “0.7.0”,
"@ionic/storage": “1.1.6”,
“angular2-jwt”: “0.1.23”,
“angular2-moment”: “^1.0.0-beta.rc.1”,
“angular2-simple-countdown”: “0.0.6”,
“angularfire2”: “^4.0.0-rc.0”,
“cordova-android”: “^6.2.3”,
“cordova-ios”: “^4.4.0”,
“cordova-plugin-badge”: “~0.7.4”,
“cordova-plugin-cocoapod-support”: “^1.3.0”,
“cordova-plugin-file”: “~4.3.1”,
“cordova-plugin-file-transfer”: “~1.6.1”,
“cordova-plugin-mixpanel”: “^3.0.1”,
“cordova-plugin-statusbar”: “~2.2.2”,
“firebase”: “^3.9.0”,
“i”: “^0.3.5”,
“ionic-angular”: “3.5.0”,
“ionic-image-loader”: “^1.6.0”,
“ionic-native”: “2.2.3”,
“ionic-plugin-deploy”: “~0.6.7”,
“ionicons”: “3.0.0”,
“moment”: “^2.18.1”,
“ng2-image-lazy-load”: “^2.0.9”,
“ng2-translate”: “3.0.0”,
“npm”: “^4.6.1”,
“phonegap-plugin-push”: “https://github.com/timeseriesBH/phonegap-plugin-push#v1.8.3.4”,
“rxjs”: “5.0.0-beta.12”,
“sw-toolbox”: “^3.6.0”,
“zone.js”: “0.6.21”
},
“devDependencies”: {
"@ionic/app-scripts": “^1.3.4”,
"@ionic/cli-plugin-cordova": “1.4.0”,
"@ionic/cli-plugin-ionic-angular": “1.3.1”,
"@types/request": “0.0.30”,
“rollup-plugin-commonjs”: “^8.0.2”,
“rollup-plugin-json”: “^2.3.0”,
“rollup-plugin-node-builtins”: “^2.1.2”,
“rollup-plugin-node-globals”: “^1.1.0”,
“rollup-plugin-node-resolve”: “^3.0.0”,
“typescript”: “^2.2.0”
},

This doesn’t match. It should match.

I have installed recently ionic-angular last version but till fails:

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1 
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.4
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.2.3 ios 4.4.0
Ionic Framework                 : ionic-angular 3.5.0

System:

Node       : v7.6.0
OS         : Linux 4.4
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.4

Your packages are still all kind of broken. Make sure stuff matches the current state of https://github.com/ionic-team/ionic2-app-base/blob/master/package.json if you want to really update to 3.5.0.

If there is no good reason these are there then get rid of all of them:[quote=“MarinoRaul, post:8, topic:96943”]
“npm”: “^4.6.1”,
[/quote]

It seems that not working npm install for me in package json, nothing changes for me.
I have delete node_modules and npm install again and I got the same error

Any trick to probe for resolve this???

Thanks!

You use npm5 so you have to delete packages-lock.json before running npm install as well.

I should to delete the file or delete the dependencies inside the file???

Thanks

You should delete the file. If it exists, npm install just installs what was installed the last time (and what is saved in this file).

If you don’t use npm for anything other than Ionic: Delete node-modules and package-lock.json. Then run npm cache clean --force. After all that is done, reinstall Ionic, cordova, and anything else you need.

You are also going to have trouble with ionic-native unless you get all versions (including core) over 3.6.0.

1 Like