Electron - WebApp - error chouchbase_impl.node

Hi all,
i have a webapp whit a couchbase node.js SDK,
i want to use a Electron for have a desktop application.
But when i start the electron app, i have this error

this is my package.json

{
  "name": "Search",
  "version": "0.0.1",
  "description": "Simple Search Application In Couchbase.",
  "main": "main.js",
  "author": "jempis",
  "build": {
    "appId": "com.search",
    "files": [
      "./**/*",
      "node_modules/**/*",
      "package.json",
      "main.js"
    ]
  },
  "script": {
    "postinstall": "install-app-deps",
    "start": "electron main.js",
    "release": "build",
    "pack": "electron-builder --dir",
    "dist": "electron-builder",
    "rebuild": "electron-rebuild -f -w couchbase"
  },
  "dependencies": {
    "body-parser": "^1.18.2",
    "couchbase": "^2.0.8",
    "express": "^4.16.2",
    "method-override": "^2.3.10",
    "morgan": "^1.9.0",
    "mime": "^2.1.0"
  },
  "devDependencies": {
    "electron": "^1.4.10",
    "electron-builder": "^19.55.2",
    "electron-packager": "^8.1.0",
    "electron-rebuild": "^1.7.3"
  }
}

and this is may project structure:

where

  • ‘app’ folder contains the NodeJS “BackEnd” whit couchbase sdk
  • ‘public’ folder is the AngulaJS “FrontEnd”
  • server.js file is the express nodejs server
  • main.js is the electron file

have any idea for resolve this error?
thanks

Hey @jempis02,

Unfortunately Electron is not one of our tested platforms, so we do not have a lot of background knowledge on why this may be failing. I will try to put a build together sometime this week to try and identify any changes we can make to improve support across the various Electron releases.

Cheers, Brett

hi @brett19,
thanke for the response,
we hope you can solve the problem, I would love to use electron.

@avsej thank you for edit :relaxed:

Thanks
J

Hi @jempis02,

I would not advise using the Couchbase Node.js SDK in an Electron application because it is not good practice to connect to Couchbase or any server side database directly from a client facing application. Doing so would require you to store your database credentials within the application which could then be easily decompiled by a malicious user.

It would be best to create a hosted API that uses the Couchbase SDK and communicate with it via Node.js or Angular from Electron.

However, it is just a suggestion, and you can proceed how you’d like :slight_smile: