castlabs / electron-releases

castLabs Electron for Content Security
https://castlabs.com/resources/downstream/
MIT License
222 stars 41 forks source link

cannot resolve https://github.com/electron/electron/releases/download/v27.0.0+wvcus/electron-v27.0.0+wvcus-win32-x64.zip: status code 404 #181

Open iamharshitpandeyy opened 5 months ago

iamharshitpandeyy commented 5 months ago

cannot resolve https://github.com/electron/electron/releases/download/v27.0.0+wvcus/electron-v27.0.0+wvcus-win32-x64.zip: status code 404

khwaaj commented 5 months ago

The URL is wrong, this tries to download an ECS release from the official Electron repo. When you are packaging with something like electron-builder you need to set at mirror to get the correct URL. Check out this FAQ: https://github.com/castlabs/electron-releases/wiki/FAQ#how-can-i-use-electron-builder-with-ecs

iamharshitpandeyy commented 5 months ago

So we have to add it to our package. json NodeJS, right ? Do we have to add something after the "v" in the string "https://github.com/castlabs/electron-releases/releases/download/v" like version ?

khwaaj commented 5 months ago

Yeah, you need to add It to your package.json, more details are available in the electron-builder documentation if you need it. You should not have to add extra after download/v, this is just the first part of the URL that is used to assemble the final one so the version will be attached automatically.

iamharshitpandeyy commented 5 months ago
{
        "name": <name>,
        "version": "0.1.1",
        "private": true,
        "main": "public/electron.js",
        "homepage": "./",
        "dependencies": {
         //dependency
        },
        "scripts": {
          "dev": "concurrently -k \"cross-env BROWSER=none npm start\" \"npm:electron:serve\"",
          "dev-teacher": "concurrently -k \"cross-env BROWSER=none npm run react:teacher\" \"npm:electron:serve:teacher\"",
          "dev-student": "concurrently -k \"cross-env BROWSER=none npm run react:student\" \"npm:electron:serve:student\"",
          "electron:serve": "wait-on tcp:3000 && electron .",
          "electron:serve:teacher": "set USER_TYPE=TEACHER&&set PORT=3000&&wait-on tcp:3000 && electron .",
          "electron:serve:student": "set USER_TYPE=STUDENT&&set PORT=4000&&wait-on tcp:4000 && electron .",
          "electron:start": "electron .",
          "electron:build:dev": "npm run build && electron-builder -c.extraMetadata.main=build/electron.js --config electron-builder.dev.yaml",
          "electron:build:prod": "npm run build && electron-builder -c.extraMetadata.main=build/electron.js --config electron-builder.prod.yaml",
          "electron:publish:dev": "electron-builder --config electron-builder.dev.yaml --win -p always",
          "electron:publish:prod": "electron-builder --config electron-builder.prod.yaml --win -p always",
          "react:teacher": "set PORT=3000 && react-scripts start --max-old-space-size=16384",
          "react:student": "set PORT=4000 && react-scripts start --max-old-space-size=16384",
          "start": "react-scripts start --max-old-space-size=16384",
          "build": "react-scripts build --max-old-space-size=16384",
          "test": "react-scripts test",
          "eject": "react-scripts eject"
        },
        "eslintConfig": {
          "extends": [
            "react-app",
            "react-app/jest"
          ]
        },
        "browserslist": {
          "production": [
            "defaults",
            "not ie 11"
          ],
          "development": [
            "last 1 chrome version",
            "last 1 firefox version",
            "last 1 safari version"
          ]
        },
        "devDependencies": {
          "electron": "github:castlabs/electron-releases#v27.0.0+wvcus",
          "electron-builder": "^24.9.1",
          "tailwindcss": "^3.3.3",
          "webpack-node-externals": "^3.0.0"
        },
        "build": {
        "electronDownload": {
          "mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
        }
      }
}

Still It's was not building, showing same issue

khwaaj commented 5 months ago

That should work in general, maybe you have some conflicting state or configuration?

For example this package.json from a quick start project works fine:

{
  "name": "electron-quick-start",
  "version": "1.0.0",
  "description": "A minimal Electron application",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "dist": "electron-builder"
  },
  "repository": "https://github.com/electron/electron-quick-start",
  "keywords": [
    "Electron",
    "quick",
    "start",
    "tutorial",
    "demo"
  ],
  "author": "GitHub",
  "license": "CC0-1.0",
  "devDependencies": {
    "electron": "github:castlabs/electron-releases#v29.1.5+wvcus",
    "electron-builder": "^24.9.1"
  },
  "build": {
    "electronDownload": {
      "mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
    }
  }
}
John7125 commented 4 months ago

@iamharshitpandeyy Brother, I have encountered this problem too, have you solved this problem?