Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging error, file not found #3349

Open
3 tasks done
xujiajun5175 opened this issue Sep 13, 2023 · 1 comment
Open
3 tasks done

Packaging error, file not found #3349

xujiajun5175 opened this issue Sep 13, 2023 · 1 comment

Comments

@xujiajun5175
Copy link

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.4.2

Electron version

26.2.1

Operating system

macos 13.4

Last known working Electron Forge version

6.4.2

Expected behavior

when i used package command

"An unhandled rejection has occurred inside Forge:
Error: ENOENT: no such file or directory, stat '/private/var/folders/nl/bg8c1j554f992v80ccqbz57c0000gn/T/electron-packager/darwin-x64/first-app-darwin-x64-yb3210/Electron.app/Contents/Resources/app/node_modules/electron-squirrel-startup'"

my mac is m1 chip

project is electron-forge default demo

Actual behavior

I encountered an error when packaging according to the instructions in the document

Steps to reproduce

I encountered an error when packaging according to the instructions in the document

{
    "name": "first-app",
    "productName": "first-app",
    "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": "xujiajun",
        "email": "15151832830@163.com"
    },
    "license": "MIT",
    "devDependencies": {
        "@electron-forge/cli": "^6.4.2",
        "@electron-forge/maker-deb": "^6.4.2",
        "@electron-forge/maker-dmg": "^6.4.2",
        "@electron-forge/maker-rpm": "^6.4.2",
        "@electron-forge/maker-squirrel": "^6.4.2",
        "@electron-forge/maker-zip": "^6.4.2",
        "@electron-forge/plugin-auto-unpack-natives": "^6.4.2",
        "@electron-forge/plugin-vite": "^6.4.2",
        "@typescript-eslint/eslint-plugin": "^5.62.0",
        "@typescript-eslint/parser": "^5.62.0",
        "electron": "26.2.1",
        "eslint": "^8.49.0",
        "eslint-plugin-import": "^2.28.1",
        "ts-node": "^10.9.1",
        "typescript": "~4.5.4"
    },
    "dependencies": {
        "electron-squirrel-startup": "^1.0.0"
    }
}

force.config.ts
import type { ForgeConfig } from '@electron-forge/shared-types'
import { MakerSquirrel } from '@electron-forge/maker-squirrel'
import { MakerZIP } from '@electron-forge/maker-zip'
import { MakerDMG } from '@electron-forge/maker-dmg'
import { MakerDeb } from '@electron-forge/maker-deb'
import { MakerRpm } from '@electron-forge/maker-rpm'
import { VitePlugin } from '@electron-forge/plugin-vite'

const config: ForgeConfig = {
    packagerConfig: {},
    rebuildConfig: {},
    makers: [
        // new MakerSquirrel({}),
        new MakerZIP({}, ['darwin']),
        new MakerRpm({}),
        new MakerDMG({}),
        new MakerDeb({}),
    ],
    plugins: [
        new VitePlugin({
            // `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
            // If you are familiar with Vite configuration, it will look really familiar.
            build: [
                {
                    // `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
                    entry: 'src/main.ts',
                    config: 'vite.main.config.ts',
                },
                {
                    entry: 'src/preload.ts',
                    config: 'vite.preload.config.ts',
                },
            ],
            renderer: [
                {
                    name: 'main_window',
                    config: 'vite.renderer.config.ts',
                },
            ],
        }),
    ],
}

export default config

Additional information

No response

@caoxiemeihao
Copy link
Member

caoxiemeihao commented Jan 18, 2024

Perhaps the PR #3336 fixed this issue. You can try upgrading the @typescript-eslint/eslint-plugin after the new version is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants