electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.5k stars 520 forks source link

Installer fails to install fuses packages #3768

Open evan1026 opened 15 hours ago

evan1026 commented 15 hours ago

Pre-flight checklist

Electron Forge version

7.5.0

Electron version

v33.2.0

Operating system

Ubuntu 24.04.1 LTS

Last known working Electron Forge version

No response

Expected behavior

npx create-electron-app --template=vite-typescript installs the template successfully

Actual behavior

The template fails to install with the following output:

$ npx create-electron-app -f --template=vite-typescript
✔ Locating custom template: "vite-typescript"
✔ Initializing directory
✔ Preparing template
✔ Initializing template
⚠ Installing template dependencies
  ✔ Installing production dependencies
  ✖ Failed to install modules: ["@electron/fuses@^1.7.0","@electron-forge/plugin-fuses@^7.2.0","@electron-forge/plugin-vite@^7.5.0","@typescript-eslint/eslint-plugin@^5.0.0","@typescript-eslint/parser@^5.0.0","eslint@^8.0.1","eslint-plugin-import@^2.25.0","ts-node@^10.
    0.0","typescript@~4.5.4","vite@^5.0.12"]
    With output: Command failed with a non-zero return code (1):
    npm install @electron/fuses@^1.7.0 @electron-forge/plugin-fuses@^7.2.0 @electron-forge/plugin-vite@^7.5.0 @typescript-eslint/eslint-plugin@^5.0.0 @typescript-eslint/parser@^5.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.0 ts-node@^10.0.0 typescript@~4.5.4
    vite@^5.0.12 --save-dev
  ⚠ Finalizing dependencies
    ✖ Failed to install modules: ["electron-squirrel-startup"]
      With output: Command failed with a non-zero return code (1):
      npm install electron-squirrel-startup --save
    ✔ Skip linking forge dependencies

Steps to reproduce

Run npx create-electron-app -f --template=vite-typescript on the command line

Additional information

Adding DEBUG=electron-forge:* gives this output:

...
❯ Installing development dependencies
  electron-forge:init installing devDependencies +1ms
› npm install --dev @electron/fuses@^1.7.0 @electron-forge/plugin-fuses@^7.2.0 @electron-forge/plugin-vite@^7.5.0 @typescript-eslint/eslint-plugin@^5.0.0 @typescript-eslint/parser@^5.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.0 ts-node@^10.0.0 typescript@~4.5.4 vite@^5.0.12
  electron-forge:dependency-installer installing ["@electron/fuses@^1.7.0","@electron-forge/plugin-fuses@^7.2.0","@electron-forge/plugin-vite@^7.5.0","@typescript-eslint/eslint-plugin@^5.0.0","@typescript-eslint/parser@^5.0.0","eslint@^8.0.1","eslint-plugin-import@^2.25.0","ts-node@^10.0.0","typescript@~4.5.4","vite@^5.0.12"] in: /home/evan1026/git/temp depType=DEV,versionRestriction=RANGE,withYarn=false +1ms
  electron-forge:dependency-installer executing ["install","@electron/fuses@^1.7.0","@electron-forge/plugin-fuses@^7.2.0","@electron-forge/plugin-vite@^7.5.0","@typescript-eslint/eslint-plugin@^5.0.0","@typescript-eslint/parser@^5.0.0","eslint@^8.0.1","eslint-plugin-import@^2.25.0","ts-node@^10.0.0","typescript@~4.5.4","vite@^5.0.12","--save-dev"] in: /home/evan1026/git/temp +0ms
✖ Installing development dependencies [FAILED: Failed to install modules: ["@electron/fuses@^1.7.0","@electron-forge/plugin-fuses@^7.2.0","@electron-forge/plugin-vite@^7.5.0","@typescript-eslint/eslint-plugin@^5.0.0","@typescript-eslint/parser@^5.0.0","eslint@^8.0.1","eslint-plugin-import@^2.25.0","ts-node@^10.0.0","typescript@~4.5.4","vite@^5.0.12"]

With output: Command failed with a non-zero return code (1):
npm install @electron/fuses@^1.7.0 @electron-forge/plugin-fuses@^7.2.0 @electron-forge/plugin-vite@^7.5.0 @typescript-eslint/eslint-plugin@^5.0.0 @typescript-eslint/parser@^5.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.0 ts-node@^10.0.0 typescript@~4.5.4 vite@^5.0.12 --save-dev
]
❯ Finalizing dependencies
❯ Installing common dependencies
  electron-forge:init:npm installing dependencies +0ms
› npm install electron-squirrel-startup
  electron-forge:dependency-installer installing ["electron-squirrel-startup"] in: /home/evan1026/git/temp depType=PROD,versionRestriction=RANGE,withYarn=false +8s
  electron-forge:dependency-installer executing ["install","electron-squirrel-startup","--save"] in: /home/evan1026/git/temp +0ms
✖ Installing common dependencies [FAILED: Failed to install modules: ["electron-squirrel-startup"]

With output: Command failed with a non-zero return code (1):
npm install electron-squirrel-startup --save
]
❯ Skip linking forge dependencies
  electron-forge:init:link LINK_FORGE_DEPENDENCIES_ON_INIT is falsy. Skipping. +0ms
✔ Skip linking forge dependencies
✔ Finalizing dependencies
✔ Installing template dependencies

Attempting to install the packages manually also fails:

$ npm install @electron/fuses@^1.7.0 @electron-forge/plugin-fuses@^7.2.0 @electron-forge/plugin-vite@^7.5.0 @typescript-eslint/eslint-plugin@^5.0.0 @typescript-eslint/parser@^5.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.0 ts-node@^10.0.0 typescript@~4.5.4 vite@^5.0.12 --save-dev
npm error code ENOTEMPTY
npm error syscall rename
npm error path /home/evan1026/git/temp/node_modules/@electron/fuses
npm error dest /home/evan1026/git/temp/node_modules/@electron/.fuses-hH5hA56J
npm error errno -39
npm error ENOTEMPTY: directory not empty, rename '/home/evan1026/git/temp/node_modules/@electron/fuses' -> '/home/evan1026/git/temp/node_modules/@electron/.fuses-hH5hA56J'
npm error A complete log of this run can be found in: /home/evan1026/.npm/_logs/2024-11-22T06_42_49_994Z-debug-0.log

I can get the packages to install my doing the rename myself, but then the electron install still fails:

$ mv /home/evan1026/git/temp/node_modules/@electron/fuses /home/evan1026/git/temp/node_modules/@electron/.fuses-hH5hA56J

$ npm install @electron/fuses@^1.7.0 @electron-forge/plugin-fuses@^7.2.0 @electron-forge/plugin-vite@^7.5.0 @typescript-eslint/eslint-plugin@^5.0.0 @typescript-eslint/parser@^5.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.0 ts-node@^10.0.0 typescript@~4.5.4 vite@^5.0.12 --save-dev
npm warn skipping integrity check for git dependency ssh://git@github.com/electron/node-gyp.git
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm warn deprecated xterm-addon-search@0.8.2: This package is now deprecated. Move to @xterm/addon-search instead.
npm warn deprecated xterm-addon-fit@0.5.0: This package is now deprecated. Move to @xterm/addon-fit instead.
npm warn deprecated boolean@3.2.0: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated xterm@4.19.0: This package is now deprecated. Move to @xterm/xterm instead.
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 577 packages, removed 299 packages, changed 4 packages, and audited 583 packages in 8s

156 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ npx create-electron-app -f --template=vite-typescript
✔ Locating custom template: "vite-typescript"
✔ Initializing directory
  › ⚠ The specified path "/home/evan1026/git/temp" is not empty. "force" was set to true, so proceeding to initialize. Files may be overwritten
✔ Preparing template
❯ Initializing template
  ✔ Copying starter files
  ✔ Initializing package.json
  ✔ Setting up Forge configuration
  ✖ dest already exists.
◼ Installing template dependencies