-
Notifications
You must be signed in to change notification settings - Fork 264
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
wp-now: Error if node doesn't meet the minimum required version #434
Conversation
@adamziel How do I test the built version? Here's what I tried:
|
But wait:
|
@adamziel Er, but then I'd be using
ChatGPT says it's not quite the same effect:
Are other packages run at the command line? How would we test this? |
Ah, I see. That's going to be tough in the current setup. It needs to import dependencies that don't live in node_modules and nx sets up a custom loader to enable that. Here's a different idea: build wp-now, the binary, as a single bundle and avoid importing things at all.
It doesn't have the same effect but it is the standard way of solving this problem for a developer working with the repository clone. The problem with checking node version is that it won't work if you run wp-now outside of Node. Like in Deno, or in the VS Code extension, or (probably) in Stackblitz. As for someone including wp-now in their project dependencies, that sounds like a node problem, not wp-now problem. The issue is with a missing Event class – maybe they shimmed that? Why prevent them from using a package they were able to install?
It's |
This is fixing the issue identified in WordPress/playground-tools#11, which originated from
This seems like a separate issue...
Maybe we should do both? |
Thanks for clarifying! From the stack trace, that's a
It is a separate issue. I'm just answering the question of how to run it like a
I wouldn't – Node is just one way of running JavaScript. Logging a warning without exiting could be a good middle-ground here. |
Per our conversation, we'll add |
Fixes #429
What?
Exits with an error if node doesn't meet the minimum required version.
Why?
Without this,
wp-now
fails cryptically and provides no context for how it fails.Testing Instructions
TBD