Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

347
Vistas
Cannot find module 'firebase-admin/app' - How to fix?

I'm using Typescript with firebase-admin for firebase cloud function and I get "Cannot find module 'firebase-admin/app'" when compiling the code with TS. Already tried:

  • Re-Install Dependency
  • Delete node_modules

My Import:

import { initializeApp } from 'firebase-admin/app';

I've also tried changing the import to the following. Then TS is satisfied, however Firebase Cloud function throws an error "cannot find module 'firebase-admin/app'"

const { initializeApp }  = require('firebase-admin/app')

My Package.json

{
  "name": "functions",
  "scripts": {
    "build": "tsc",
    "serve": "npm run build && firebase emulators:start --only functions",
    "shell": "npm run build && firebase functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "16"
  },
  "main": "lib/index.js",
  "dependencies": {
    "firebase-admin": "^10.0.2",
    "firebase-functions": "^3.14.1",
    "moment": "^2.29.1",
    "node-fetch": "2.6.7"
  },
  "devDependencies": {
    "firebase-functions-test": "^0.2.0",
    "typescript": "^3.8.0"
  },
  "private": true
}

This is my tsconfig.json.

{
  "compilerOptions": {
    "module": "commonjs",
    "noImplicitReturns": true,
    "noUnusedLocals": false,
    "outDir": "lib",
    "sourceMap": true,
    "strict": false,
    "target": "es2017"
  },
  "compileOnSave": true,
  "include": [
    "src"
  ]
}

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are using "firebase-admin": "^10.0.2" which uses exports in module package.json to define the entry points. This won't work with eslint-plugin-import. Use the below line at the start of the file and try again.

// eslint-disable-next-line import/no-unresolved
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda