1

I'm trying to build an electron app with electron builder, but I encountered a problem: my network blocks packages from GitHub on downloading.

Is there any other way to disable the look for the packages while online?

the script code:

"electron:admin": "electron-builder -c.extraMetadata.main=build/main.js",

the electron builder part of package.json:

  "build": {
    "extends": null,
    "icon": "build/logo.ico",
    "files": [
      "build/**/*",
      "package.json"
    ],
    "extraFiles": [
      {
        "from": "../database-client.db",
        "to": "./database-client.db",
        "filter": [
          "**/*"
        ]
      },
      {
        "from": "../clientUploads/",
        "to": "./uploads/",
        "filter": [
          "**/*"
        ]
      }
    ],
    "directories": {
      "buildResources": "assets"
    }
  },

I'm building for windows only

I solved that by building the application outside the network and copying the AppData files of electron and electron builder. When I'm building the app I turn down the connection to the internet so the electron builder will not look for the GitHub packages.

I still did not find a way to do that While I'm online.

1 Answer 1

0

is possible with :

_electron_dist=/usr/lib/electron
_electron_ver=$(cat ${_electron_dist}/version)

npm exec -c "electron-builder --linux --dir -c.electronDist=${_electron_dist} -c.electronVersion=${_electron_ver}" 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.