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.

App will be installed but is not visible due to invalid JS syntax

See original GitHub issue
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue: Hello.I have made an app using electron-forge.I run npm run make to generate a deb file for Ubuntu 18.04.After app is made I install it.However after that I am not able to find it in the app drawer or starting it from cli using its name

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

DEBUG=electron-forge:* npm run make:only

> app-list@1.0.0 make:only /home/mkcodergr/Documents/GitHub/app-list
> electron-forge make --skip-package

WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +4s
  electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Resolving Forge Config +0ms
  electron-forge:project-resolver searching for project in: /home/mkcodergr/Documents/GitHub/app-list +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in /home/mkcodergr/Documents/GitHub/app-list/package.json +19ms
  electron-forge:lifecycle Process Succeeded: Resolving Forge Config +41ms
  electron-forge:require-search searching [ '../makers/linux/deb.js',
  '../makers/generic/deb.js',
  'electron-forge-maker-deb',
  'deb',
  '/home/mkcodergr/Documents/GitHub/app-list/deb',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/deb',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/makers/linux/deb.js',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/makers/generic/deb.js',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/api/electron-forge-maker-deb',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/api/deb',
  '/home/mkcodergr/Documents/GitHub/app-list/deb',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/deb',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/api/makers/linux/deb.js',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/api/makers/generic/deb.js',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/api/node_modules/electron-forge-maker-deb',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/api/node_modules/deb',
  '/home/mkcodergr/Documents/GitHub/app-list/deb',
  '/home/mkcodergr/Documents/GitHub/app-list/node_modules/deb' ] relative to /home/mkcodergr/Documents/GitHub/app-list/node_modules/electron-forge/dist/api +0ms
  electron-forge:require-search testing ../makers/linux/deb.js +6ms
WARNING: Skipping the packaging step, this could result in an out of date build
Making for the following targets:
  electron-forge:hook could not find hook: preMake +0ms
  electron-forge:lifecycle Process Started: Making for target: deb - On platform: linux - For arch: x64 +193ms
  electron-forge:lifecycle Process Succeeded: Making for target: deb - On platform: linux - For arch: x64 +3m
  electron-forge:hook could not find hook: postMake +3m

What command line arguments are you passing?

Put the arguments here

What does your config.forge data in package.json look like?

Paste the config.forge JSON object here
"config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip"
        ],
        "linux": [
          "deb"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "yarn"
      },
      "electronWinstallerConfig": {
        "name": "app_list"
      },
      "electronInstallerDebian": {
        "productName":"Node app lister",
        "name":"app-list",
        "description":"Manage your node apps with ease"
      },
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "applist"
      }
    }
  },

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to reproduce your problem. Using electron-forge init is a good starting point, if that is not the source of your problem.

Run electron-forge init app-list
copy and paste the following package.json
{
  "name": "app-list",
  "productName": "Node app lister",
  "version": "1.0.0",
  "description": "Manage NodeJS apps with eNode app lister",
  "main": "src/bootstrap.js",
  "scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "make:only": "electron-forge make --skip-package",
    "publish": "electron-forge publish",
    "lint": "eslint src --color"
  },
  "keywords": [],
  "author": "mkcodergr",
  "license": "MIT",
  "config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip"
        ],
        "linux": [
          "deb"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": "yarn"
      },
      "electronWinstallerConfig": {
        "name": "app_list"
      },
      "electronInstallerDebian": {
        "productName":"Node app lister",
        "name":"app-list",
        "description":"Manage your node apps with ease"
      },
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "applist"
      }
    }
  },
  "dependencies": {
    "dialogs": "^1.1.20",
    "electron-compile": "^6.4.2",
    "electron-squirrel-startup": "^1.0.0",
    "mongoose": "^5.1.4",
    "pm2": "^2.10.4"
  },
  "devDependencies": {
    "babel-plugin-transform-async-to-generator": "^6.24.1",
    "babel-preset-env": "^1.7.0",
    "babel-preset-react": "^6.24.1",
    "electron-forge": "^5.2.2",
    "electron-prebuilt-compile": "2.0.2",
    "eslint": "^3",
    "eslint-config-airbnb": "^15",
    "eslint-plugin-import": "^2",
    "eslint-plugin-jsx-a11y": "^5",
    "eslint-plugin-react": "^7"
  }
}

Run npm make and Install the generated deb file
Try to find it in the app drawer or by typing app-list.None works


My system is running on Ubuntu 18.04 Electron forge version 5.2.2

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
maleptcommented, Jun 7, 2018

Run npm init app-list

Do you mean electron-forge init app-list?

Also, it sounds less like a problem with Electron Forge and more of a problem with your app code. Can you provide a link to your app code (a GitHub repo, perhaps)?

0reactions
maleptcommented, Jun 11, 2018

This isn’t a bug with Electron Forge. Here’s the error message:

Failed to compile file: /tmp/electron-packager/linux-x64/Node app lister-linux-x64/resources/app/src/scripts/index.js
/tmp/electron-packager/linux-x64/Node app lister-linux-x64/resources/app/src/scripts/index.js: Unexpected token, expected { (158:11)

Here’s the code that it’s failing on:

https://github.com/kounelios13/App-list/blob/cae4b9d2e92cc4604f0134c96008a1555ddc2ee6/src/scripts/index.js#L157-L158

Remove the function keyword and it’ll probably work.

In the future, you may want to visit one of the community forums if you want a more timely answer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix `SyntaxError: Invalid or unexpected token` when ...
Open PowerShell and create a new directory: mkdir NodeApp , then enter the directory: cd NodeApp. Open the directory and your app.js file...
Read more >
SyntaxError: missing ; before statement - JavaScript | MDN
The JavaScript exception "missing ; before statement" occurs when there is a semicolon ( ; ) missing somewhere and can't be added by...
Read more >
Working with JavaScript in Visual Studio Code
If you have npm installed but still see a warning message, you can explicitly tell VS Code where npm is installed with the...
Read more >
Common issues and resolutions for Power Apps
Power Apps Studio will not load from Power BI Desktop on versions ... Power Apps won't show canvas apps connecting to SharePoint that...
Read more >
Twitter API Response Codes & Error Support - Twitter Developer
There was a problem authenticating your request. This could be due to missing or incorrect authentication credentials. This may also be returned in...
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