wp-now: Error if node doesn't meet the minimum required version#434
wp-now: Error if node doesn't meet the minimum required version#434danielbachhuber merged 1 commit intotrunkfrom
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-nowfails cryptically and provides no context for how it fails.Testing Instructions
TBD