Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

341
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!