Estoy haciendo un proyecto con Firebase, para esto instalé Angularfire2
con npm install angularfire2 firebase --save
, pero me salía el siguiente error en la terminal:
npm install firebase angularfire2 --save
npm WARN [email protected] requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
+ [email protected]
+ [email protected]
updated 2 packages in 15.909s
Revisando mi package.json
me di cuenta que los paquetes tenían otras versiones al mensaje de error:
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/http": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"angularfire2": "^5.0.0-rc.6.0",
"bootstrap": "^4.1.0",
"core-js": "^2.4.1",
"firebase": "^4.13.1",
"jquery": "^3.3.1",
"popper.js": "^1.14.3",
"rxjs": "^5.5.6",
"zone.js": "^0.8.19"
},
Probé con el comando npm update
, pero ahora me genera el siguiente error y el proyecto no arranca.
ERROR in node_modules/angularfire2/auth/auth.d.ts(1,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/firebase.app.module.d.ts(3,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/firestore/collection/changes.d.ts(1,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/firestore/collection/collection.d.ts(1,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/firestore/document/document.d.ts(1,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/firestore/firestore.d.ts(1,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/firestore/interfaces.d.ts(2,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/firestore/observable/fromRef.d.ts(1,27): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/storage/observable/fromTask.d.ts(1,25): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/storage/ref.d.ts(1,25): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/storage/storage.d.ts(1,25): error TS2307: Cannot find module 'firebase/app'.
node_modules/angularfire2/storage/task.d.ts(1,25): error TS2307: Cannot find module 'firebase/app'.
Esta es la información de mi versión de Angular-cli
Angular CLI: 1.7.4
Node: 8.10.0
OS: darwin x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@angular/cli: 1.7.4
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
Mi versión de node v8.10.0
y versión de npm 5.6.0
.