forge icon indicating copy to clipboard operation
forge copied to clipboard

When running "electron forge npm start", it shows an error indicating an incorrect version of Node.js.

Open qaz6237326 opened this issue 6 months ago • 1 comments

Pre-flight checklist

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

Forge version

7.8.1

Electron version

36.4.0

Operating system

windows10

Last known working Forge version

7.8.1

Expected behavior

starting success

Actual behavior

I created a new project using “npx create-electron-app@latest my-app”, but encountered an issue when running “npm start”. I have tried switching to the updated version using nvm, or uninstalling nodejs and reinstalling it. However, it still shows that the current version is 16.1.0. But in fact, there is no 16.1.0 in my nvm. Even when I switched to another computer, the problem remained the same. I actually installed the 18+ and 22+ versions of nodejs, and did switch the versions. I checked if the switch was successful by running "nodejs -v". However, when I ran "npm start" in the Forge project, it still showed an error:

my-app@1. 0. 0 start electron-forge start You are rumming Node. js version 16. 1.0, but Electron Forge requires Node. js >= 16.4. 0.

Steps to reproduce

1、create project

npx create-electron-app@latest my-app --template=vite-typescript

2、installation compete 3、cd my-app && npm start

my-app@1. 0. 0 start electron-forge start You are rumming Node. js version 16. 1.0, but Electron Forge requires Node. js >= 16.4. 0.

Additional information

No response

qaz6237326 avatar Jun 23 '25 00:06 qaz6237326

Can you paste the output of node -v and which node? (Important, not nodejs -v which you mentioned in the issue!)

nikwen avatar Jun 23 '25 16:06 nikwen