angularfire: Cannot find module 'angularfire2' when using Angular-CLI and RC.4
I’m using angular-cli with the lastest RC4 version of Angular.
I was following the steps here:
https://github.com/angular/angularfire2/blob/master/docs/1-install-and-setup.md
But I had to make a few very small changes. For one, I’m installing AngularFire this way:
npm install git+https://github.com/angular/angularfire2.git --save
so that I have a version that is compatible with RC4.
Secondly, when doing the typings step I do this:
typings install file:node_modules/firebase/firebase.d.ts --save --global && typings install
because that’s where the firebase.d.ts file is now it seems.
Next I do this:
var map = {
'firebase': 'vendor/firebase/firebase.js',
'angularfire2': 'vendor/angularfire2'
};
/** User packages configuration. */
var packages = {
angularfire2: {
defaultExtension: 'ts',
main: 'angularfire2.ts'
}
};
Where I use the .ts file because there isn’t a .js file for angularfire2 in the node_modules/angularfire2 folder. Even in the source folder it’s just .ts files.
So, once I get to step 7, and do this:
import { FIREBASE_PROVIDERS, defaultFirebase } from 'angularfire2';
everything falls apart. I’m not sure why, it should work?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 58
have you tried installing the angularfire suggested in the setup? Actually that’s what I’m using and its working on RC4.
Believe me, I’m trying to get your error but I can’t. It works fine on me.
May be use
npm install angularfire2 firebase --save
instead of the github link you are using.Did you try creating one again from scratch like after you clean the cache and reinstalling cli again? I think i’m getting it right now. I remember i used to get same error before but after reinstalling cli and start from scratch again, like from number 1 in the set up. I finally realize that Im just too excited to code and when i
npm install angularfire2 firebase --save
I’ve wait until self termination occur, and then the error is gone.But I dont think you have done this before? Haha. Just trying man, I just help.
I tried
npm cache clean
and then ran it again:May your default extension should be
.js
and not.ts
?Here is my packages:
Its actually working on my side.