Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

1.2K
Visualizações
Cannot deploy/serve Firebase with error: No "exports" main defined in package.json

'firebase' npm package is used in Functions backend for .initializeApp(config) and .Auth().signInWithEmailAndPassword(email, password)

Firebase deploy/serve throws this error:

!  Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in <project path>\functions\node_modules\firebase\package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:299:9)
at packageExportsResolve (internal/modules/esm/resolve.js:522:3)
at resolveExports (internal/modules/cjs/loader.js:449:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:489:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:875:27)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (<project path>\functions\APIs\users.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:1072:14)

! We were unable to load your functions code. (see above)

at const firebase = require("firebase");

Re-installing firebase package, updating Node, npm and using 'firebase-admin' did not solve the issue. I'm very thankful if you can help.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The Firebase js sdk is for client-side use only. In order to interact with Firebase from your backend environment (ie cloud functions, node backend, etc), you must use the admin-sdk.

Keep in mind that since the admin-sdk runs in a secure, trusted environment, it has elevated privileges and will bypass security rules, so make sure you're validating your data in your functions.

You can view the full documentation for the admin-sdk here: Firebase Admin SDK

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda