Skip to content

Unable to start vite-typescript template - Getting Started Guide incomplete/insufficient ? #237

@HedgeWizardly

Description

@HedgeWizardly

Operating System:
Mac OS Ventura 13.7.3 (22H417)

I'm trying to start a new project from template, following instructions on https://www.electronforge.io/

  1. Open terminal
  2. cd to a directory (e.g. cd documents > cd code)
  3. npx create-electron-app@latest myprojectname --template=vite-typescript
  4. cd myprojectname
  5. code .
  6. In VS Code, open integrated terminal
  7. npm install
  8. npm run make

RESULT: sh: electron-forge: command not found

I try:

  1. npm install electron-forge -D
  2. npm run make

RESULT:

✔ Checking your system
✖ Resolving Forge Config

Electron forge was terminated:
You must depend on "electron-prebuilt-compile" in your devDependencies

At this point, my package looks like this:

{
  "name": "koboldtracker",
  "productName": "koboldtracker",
  "version": "1.0.0",
  "description": "My Electron application description",
  "main": ".vite/build/main.js",
  "scripts": {
    "start": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "publish": "electron-forge publish",
    "lint": "eslint --ext .ts,.tsx ."
  },
  "keywords": [],
  "author": {
    "name": "HedgeWizardly",
    "email": "[email protected]"
  },
  "license": "MIT",
  "devDependencies": {
    "@electron-forge/plugin-vite": "^7.8.1",
    "@typescript-eslint/eslint-plugin": "^5.62.0",
    "@typescript-eslint/parser": "^5.62.0",
    "electron-forge": "^5.2.4",
    "eslint": "^8.57.1",
    "eslint-plugin-import": "^2.32.0",
    "ts-node": "^10.9.2",
    "typescript": "~4.5.4",
    "vite": "^5.4.19"
  }
}

Following the advice in electron/forge#2024 (comment) I tried npm uninstall -g electron-forge followed again by npm run make and hit the same issue.

Next I tried npm install electron-prebuilt-compile -D which adds "electron-prebuilt-compile": "^8.2.0", to my package file.

npm run make yields:

✖ Resolving Forge Config

Electron forge was terminated:
You must depend on an EXACT version of "electron-prebuilt-compile" not a range (got "^8.2.0")```

I remove the `^` from the package definition and re-run `npm install` and try `npm run make` again afterwards. This yields:

```✔ Checking your system
✖ Resolving Forge Config

Electron forge was terminated:
You must depend on "electron-prebuilt-compile" in your devDependencies```

Please help..! I'm only a hobbyist programmer so I might be missing something potentially obvious, but to have already hit so many barriers just trying to follow the getting started guide must be a hindrance to other people too, unless it's something SPECIFICALLY off with my system..?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions