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

343
Visualizações
Error: SQLITE_CANTOPEN: unable to open database file with electron-forge packed app

I'm using a sqlite database called sqlite.db in my app. The database is located in the top directory of my app.

I test the app with npm start while developing. While testing, the database works fine.

After creating the app via npm run make (electron-forge), the database cannot be accessed with the following error: SQLITE_CANTOPEN: unable to open database file with electron-forge.

  • My first thought was a wrong directory in the code, but that doesn't seem to be the issue after all.
  • Also the database itself is available in the packed application.
  • And it doesn't seem to be a code issue as texting works fine:
    const sqlite3 = require('sqlite3');
    const { open } = require('sqlite');
    sqlite3.verbose();
    return open({
        filename,                    //filename='./sqlite.db' (actually a path)
        driver: sqlite3.Database
    });

This brings me to the conclusion, something must be wrong in the configuration for the app-building process via Electron Forge. But I have no clue if that assumption is correct - and if so, how to do that.

The closest I found to a fix was this similar issue but with Electron Builder - since I use Electron Forge, I wasn't able to apply the suggested solution 1:1...

about 4 years ago · Juan Pablo Isaza
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