Skip to content

npx create-electron-app fails on npm v12 #4353

Description

@nikwen

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.

Forge version

7.11.2

Electron version

44.0.0

Operating system

macOS 26.6.2

Last known working Forge version

No response

Expected behavior

npx create-electron-app succeeds.

Actual behavior

npx create-electron-app fails.

% npx create-electron-app .
npm notice run npx
npm notice run 'create-electron-app' .

✔ Resolving package manager: npm v12.0.2
✔ Resolving template: vite-typescript
  › Using @electron-forge/template-vite-typescript (local module)
✔ Resolving Electron version: latest
  › Using Electron version tag: latest
✔ Initializing directory
✔ Initializing git repository
✔ Preparing template
✔ Initializing template
⚠ Installing template dependencies
  ✔ Installing production dependencies
  ✖ Failed to install modules: ["@electron-forge/plugin-vite@^7.11.2","@types/electron-squirrel-startup@^1.0.2","@typescript-eslint/eslint-plugin@^5.0.0","@typescript-eslint/parser@^5.0.0","eslint@^8.0.1","esl
    int-plugin-import@^2.25.0","typescript@~4.5.4","vite@^5.0.12"]
    With output: Command failed with a non-zero return code (1):
    npm install @electron-forge/plugin-vite@^7.11.2 @types/electron-squirrel-startup@^1.0.2 @typescript-eslint/eslint-plugin@^5.0.0 @typescript-eslint/parser@^5.0.0 eslint@^8.0.1 eslint-plugin-import@^2.25.0
    typescript@~4.5.4 vite@^5.0.12 --save-dev
    npm error code EALLOWGIT
    npm error Fetching packages of type "git" have been disabled
    npm error Refusing to fetch "@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2"
    npm error A complete log of this run can be found in: /Users/nikwen/.npm/_logs/2026-08-27T12_03_07_388Z-debug-0.log
    npm error code EALLOWGIT
    npm error Fetching packages of type "git" have been disabled
    npm error Refusing to fetch "@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2"
    npm error A complete log of this run can be found in: /Users/nikwen/.npm/_logs/2026-08-27T12_03_07_388Z-debug-0.log
  ⚠ Finalizing dependencies
    ✖ Failed to install modules: ["@electron/fuses@^1.0.0","@electron-forge/cli@^7.11.2","@electron-forge/maker-squirrel@^7.11.2","@electron-forge/maker-zip@^7.11.2","@electron-forge/maker-deb@^7.11.2","@elect
      ron-forge/maker-rpm@^7.11.2","@electron-forge/plugin-auto-unpack-natives@^7.11.2","@electron-forge/plugin-fuses@^7.11.2"]
      With output: Command failed with a non-zero return code (1):
      npm install @electron/fuses@^1.0.0 @electron-forge/cli@^7.11.2 @electron-forge/maker-squirrel@^7.11.2 @electron-forge/maker-zip@^7.11.2 @electron-forge/maker-deb@^7.11.2 @electron-forge/maker-rpm@^7.11.2
      @electron-forge/plugin-auto-unpack-natives@^7.11.2 @electron-forge/plugin-fuses@^7.11.2 --save-dev
      npm error code EALLOWGIT
      npm error Fetching packages of type "git" have been disabled
      npm error Refusing to fetch "@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2"
      npm error A complete log of this run can be found in: /Users/nikwen/.npm/_logs/2026-08-27T12_03_18_810Z-debug-0.log
      npm error code EALLOWGIT
      npm error Fetching packages of type "git" have been disabled
      npm error Refusing to fetch "@electron/node-gyp@git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2"
      npm error A complete log of this run can be found in: /Users/nikwen/.npm/_logs/2026-08-27T12_03_18_810Z-debug-0.log

npm v12 disables fetching Git dependencies by default. (It also disables postinstall scripts, which causes issues with some of the dependencies that get installed.)

Steps to reproduce

  1. Upgrade npm to v12
  2. npx create-electron-app my-app

Additional information

Can be worked around with the following .npmrc:

allow-git=all

It'll also cause issues with postinstall scripts that don't run:

% npm install

up to date, audited 707 packages in 772ms

32 vulnerabilities (3 low, 1 moderate, 27 high, 1 critical)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm warn install-scripts 3 packages had install scripts blocked because they are not covered by allowScripts:
npm warn install-scripts   electron-winstaller@5.4.4 (install: node ./script/select-7z-arch.js)
npm warn install-scripts   esbuild@0.21.5 (postinstall: node install.js)
npm warn install-scripts   fsevents@2.3.3 (install: (install scripts present))
npm warn install-scripts
npm warn install-scripts Run `npm install-scripts ls` to review, or `npm install-scripts approve <pkg>` to allow.

As a result, the default packaging scripts won't work. We might want to list those packages as approved in the template package.json files.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions