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

fix(cli): add descriptive error for node version mismatch #3554

Open
3 tasks done
c6z3h opened this issue Mar 31, 2024 · 0 comments
Open
3 tasks done

fix(cli): add descriptive error for node version mismatch #3554

c6z3h opened this issue Mar 31, 2024 · 0 comments

Comments

@c6z3h
Copy link

c6z3h commented Mar 31, 2024

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

7.3.1

Electron version

v29.1.6

Operating system

macOS 13.4.1

Last known working Electron Forge version

No response

Expected behavior

Based on the docs here https://www.electronforge.io/templates/vite and running the command
npm init electron-app@latest my-new-app -- --template=vite
if on wrong node version, I believe, should yield a helpful error message like
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for my-new-app@1.0.0: wanted: {"node":">=16.4.0"} (current: {"node":"14.19.0","npm":"6.14.16"})
npm ERR! notsup Not compatible with your version of node/npm: my-new-app@1.0.0
npm ERR! notsup Not compatible with your version of node/npm: my-new-app@1.0.0.
npm ERR! notsup Required: {"node":">=16.4.0"}
npm ERR! notsup Actual: {"npm":"6.14.16","node":"14.19.0"}

Actual behavior

error message is quite generic, as such:
Error: Cannot find module 'stream/promises'
Require stack:

Steps to reproduce

use node version less than 16.4.0, and run the npm init electron-app@latest my-new-app -- --template=vite command

Additional information

figured maybe adding a .npmrc file in either packages/api/cli or packages/api/core/src with the contents
engine-strict=true would help ensure the package.json's enforce engine requirements. Besides, I'm not too sure where the entry point is, any help would be appreciated on:

  1. if this is a good thing to add, or
  2. if its too complex considering the number of entrypoints
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

1 participant