Electron-forge: Error on electron-forge package

Created on 10 Mar 2018  ยท  2Comments  ยท  Source: electron-userland/electron-forge

Console Output

stupid-machine@felli0t:~/lputouchosx$ electron-forge package
โœ” Checking your system
โ ‹ Preparing to Package Application for arch: x64Entry point: main.js

Electron forge was terminated:
The entry point to your application ("packageJSON.main") must be in a subfolder not in the top level directory

My package.json is

{
  "name": "LPUTouch",
  "version": "1.0.0",
  "description": "LPU Touch electron client",
  "main": "main.js",
  "scripts": {
    "postinstall": "install-app-deps",
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/its-arun/LPU-Touch-Electron.git"
  },
  "author": "Arun Chaudhary",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/its-arun/LPU-Touch-Electron/issues"
  },
  "homepage": "https://github.com/its-arun/LPU-Touch-Electron#readme",
  "dependencies": {
    "electron-compile": "^6.4.2",
    "electron-squirrel-startup": "^1.0.0",
    "request": "^2.83.0",
    "requests": "^0.2.2"
  },
  "devDependencies": {
    "babel-plugin-transform-async-to-generator": "^6.24.1",
    "babel-preset-env": "^1.6.1",
    "babel-preset-react": "^6.24.1",
    "electron-forge": "^5.1.1",
    "electron-prebuilt-compile": "1.8.2"
  },
  "config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel",
          "appx",
          "wix"
        ],
        "darwin": [
          "zip",
          "dmg"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "npm"
      },
      "electronWinstallerConfig": {
        "name": "LPUTouch"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "LPUTouch"
      }
    }
  }
}

Folder Structure

.
โ”œโ”€โ”€ assets
โ”‚ย ย  โ”œโ”€โ”€ lpu.png
โ”‚ย ย  โ””โ”€โ”€ ums_bg.jpg
โ”œโ”€โ”€ build
โ”‚ย ย  โ”œโ”€โ”€ background.png
โ”‚ย ย  โ”œโ”€โ”€ icon.icns
โ”‚ย ย  โ””โ”€โ”€ icon.ico
โ”œโ”€โ”€ index.css
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ index.js
โ”œโ”€โ”€ main.js
โ”œโ”€โ”€ node_modules

Most helpful comment

Can you explain why this is mandatory ?
I don't really understand.
I am somehow forced to put my package.json in the top level of my project because of the use of a template (angular-electron)

All 2 comments

The entry point to your application ("packageJSON.main") must be in a subfolder not in the top level directory

The error tells you what is wrong ๐Ÿ˜„ Your main entry point is pointing at a JS file in the top level of your app. It needs to be pointing to something in a folder. Move your code to like a src directory ๐Ÿ‘

Can you explain why this is mandatory ?
I don't really understand.
I am somehow forced to put my package.json in the top level of my project because of the use of a template (angular-electron)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

partheseas picture partheseas  ยท  3Comments

malept picture malept  ยท  4Comments

Slapbox picture Slapbox  ยท  4Comments

chenzhiguo picture chenzhiguo  ยท  5Comments

davidroman0O picture davidroman0O  ยท  5Comments