agregar en import`AngularFireModule.initializeApp(firebaseConfig),
AngularFireDatabaseModule,
AngularFireAuthModule
y importar las librerias `
import {AngularFireAuthModule} from “angularfire2/auth”;
import {AngularFireDatabaseModule} from “angularfire2/database”;
import {AngularFireModule} from “angularfire2”;```
firebase: provee una libreria de Javascript para poder acceder a la base de datos. angularfire2: adapta la libreria que provee de Javascript Firebase hacia Ionic (en este caso) promise-polyfill: es algo que necesita Firebase para que funcione correctamente los llamados
Tambien es importante aclarar que ya no se agrega en app.module el script para firebase se agrega en una archivo llamada environment que se encuentra en la carpeta llamada environment
Tuve estes error al ejecurtar el comando:
npm install angularfire2 firebase promise-polyfill --save
node-pre-gyp WARN Tried to download(501):
node-pre-gyp WARN Pre-built binaries not found for grpc@1.11.3 and node@8.11.2 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can’t find Python executable “C:\Python30\python.EXE”, you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “configure” “–fallback-to-build” “–library=static_library” “–module=C:\
Users\joguerreiro\Probando\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node” “–module_name=grpc_node” “–module_path=C:\Users\joguerreiro\Probando\node_modules\grpc\s
rc\node\extension_binary\node-v57-win32-x64-unknown” “–napi_version=3” "–node_abi_napi=napi"
gyp ERR! cwd C:\Users\joguerreiro\Probando\node_modules\grpc
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library –
module=C:\Users\joguerreiro\Probando\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\joguerreiro\Probando\node_modules\grpc\src\node\e
xtension_binary\node-v57-win32-x64-unknown --napi_version=3 --node_abi_napi=napi’ (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\joguerreiro\Probando\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\joguerreiro\Probando\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp” “install” “–fallback-to-build” "–library=static_lib
rary"
node-pre-gyp ERR! cwd C:\Users\joguerreiro\Probando\node_modules\grpc
node-pre-gyp ERR! node -v v8.11.2
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok
Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\joguerreiro\Pro
bando\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\joguerreiro\Probando\node_modules\grpc\src\node\extension_binary\node-v57-win32-
x64-unknown --napi_version=3 --node_abi_napi=napi’ (1)
npm WARN rollback Rolling back node-pre-gyp@0.10.0 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\joguerreiro\Probando\node_modules\fsevents\node_modules’
npm WARN angularfire2@5.0.0-rc.9 requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.9 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.9 requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.9 requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@5.0.0-rc.9 requires a peer of rxjs@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.11.3 install: node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.11.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
El primer error es que no encuentra python instalado en el sistema, instala python e intenta nuevamente ejecutar la instalación con npm.
No hay caso, he vuelto a instalar python y me sigue dando error. Despues probare desde otra computadora a ver si ahi puedo.