-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[Pages] Include documentation for Node Version in nextjs/deploy-a-static-nextjs-site.mdx #22530
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
base: production
Are you sure you want to change the base?
Conversation
included additional documentation for updating node vversion for a next.js static site using .nvmrc
Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment. We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally. PR Change SummaryAdded documentation for specifying Node.js version in Next.js static site deployment.
Modified Files
How can I customize these reviews?Check out the Hyperlint AI Reviewer docs for more information on how to customize the review. If you just want to ignore it on this PR, you can add the Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add |
Some Next.js projects have additional requirements for different Node.js versions. | ||
|
||
```sh | ||
You are using Node.js 18.17.1. For Next.js, Node.js version "^18.18.0 || ^19.8.0 || >= 20.0.0" is required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this sh
(rather than plain or text)?
Is it an error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, error message from build when not specifying a node version on a new default setup.
Reason Cloudflare defaults to 18.17.1 while NextJS defaults to minimum 18.18.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's one way to force a version, there are other.
Not sure if that's something we should document? Is it not really related to Cloudflare?
yes I'm aware, although most other documentation only works for Cloudflare workers which is different than the Static NextJS setup for Cloudflare Pages. Feel free to decide otherwise |
Included additional documentation for updating node version for a next.js static site using .nvmrc
Summary
Additional documentation to update Node.js version used is Cloudflare builds by default.
Recent Next.js versions require a minimum Node.js version to be used in builds. Most other documentation on specifying Node.js version applies to a full Next.js site. For a static website, the simplest approach is to update the
.nvmrc
file as Cloudflare builds use nvm for detection of node versionFixes #22529
Screenshots (optional)
Documentation checklist