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

wp-now: Include minimum node.js and npm requirements #83

Closed
jonathanbossenger opened this issue Jun 19, 2023 · 5 comments
Closed

wp-now: Include minimum node.js and npm requirements #83

jonathanbossenger opened this issue Jun 19, 2023 · 5 comments
Assignees
Labels
Documentation Improvements or additions to documentation wp-now

Comments

@jonathanbossenger
Copy link

After installing wp-now, I attempted to run it in "WordPress" mode by simply calling wp-now start inside a local WordPress directory. I was met with "ReferenceError: Event is undefined errors", which was due to running node.js version 14. I had to bump my version up to at latest LTS (version 18.20 at the time of this writing).

Therefore it might be a good idea to include a "minimum node.js and npm" requirements section in the wp-now readme.md.

FWIW this is probably because Gutenberg development used to require v 14 of node.js, but I think this has recently been updated, and I'm still on the old version.

@danielbachhuber danielbachhuber added wp-now Documentation Improvements or additions to documentation labels Jun 29, 2023
@danielbachhuber
Copy link
Member

Thanks for the report, @jonathanbossenger !

I was met with "ReferenceError: Event is undefined errors", which was due to running node.js version 14.

Out of curiosity, did you see this warning?

if (currentNodeVersion < requiredMajorVersion) {
console.warn(
`You are running Node.js version ${currentNodeVersion}, but this application recommends at least Node.js ${requiredMajorVersion} and isn't guaranteed to work on lower versions. Please upgrade your Node.js version.`
);
}

Therefore it might be a good idea to include a "minimum node.js and npm" requirements section in the wp-now readme.md.

Sounds great! Feel free to submit a pull request if you'd like.

@jonathanbossenger
Copy link
Author

jonathanbossenger commented Jul 6, 2023

Out of curiosity, did you see this warning?

Interestingly, no I did not, but it looks like this was merged on the same day as I had the error, so it's possible I did this before the update.

I'll nvm use 14 to test. If that notification exists, then perhaps the documentation update is not needed. 🤔

That being said, as a documentation nerd, I'm never going to not want to document requirements. 😁 Will work on the PR.

If I could ask you to assign this ticket to me? Thanks

@danielbachhuber danielbachhuber self-assigned this Jul 7, 2023
@danielbachhuber
Copy link
Member

danielbachhuber commented Jul 7, 2023

@ndiego ran into the same error and I was able to reproduce, so I'll get that fixed up when I have a moment. I'll also document the minimum node version when I do.

Related #87

@juanmaguitar
Copy link
Contributor

I'll also document the minimum node version when I do.

@danielbachhuber At WordPress/gutenberg#52462 I'm working on a Quick Start Guide for the Interactivity API where wp-now is recommended.
It would be great if I could include a link to the minimum requirements for wp-now along with this recommendation.

danielbachhuber added a commit that referenced this issue Jul 18, 2023
## What?

Switches back to Node 18 as the minimum supported version. Node 20 is
required for Blueprint support (it crashes otherwise).

See #83
Fixes #87
@danielbachhuber
Copy link
Member

We documented the minimum and recommended Node versions with #90

We also looked into showing the warning message for Node 14. For a variety of technical complications, we're going to leave things as-is. Gutenberg should switch to Node 18 shortly, which should improves the rocky user experience for Gutenberg contributors: WordPress/gutenberg#52363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation wp-now
Projects
None yet
Development

No branches or pull requests

3 participants