question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on electron-forge package

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

20reactions
tymmesydecommented, Sep 10, 2019

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)

19reactions
MarshallOfSoundcommented, Mar 10, 2018

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 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Could not find module with name: @electron-forge ...
After I installed electron and forge, I wanted to package after completing the instructions in the above figure, but I always got the...
Read more >
npm run make is not working in electron-forge - Stack Overflow
In my cases, it makes error when the description or author is empty in package.json file.
Read more >
Configuration - Electron Forge
Electron Forge configuration is centralized in a single configuration object. You can specify this config in your package.json on the config.forge property.
Read more >
electron-forge/core - npm
A complete tool for building modern Electron applications. Latest version: 6.0.4, last published: 19 days ago.
Read more >
Problem with packaging Electron app - Replit
I also use VS Code as my IDE. Here is the error. > my-electron-app@1.0.0 make E:\Users\me\Documents\Electron\my-electron-app. > electron-forge make.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found