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

chore(gatsby-cli): Add notice for Node 8 EOL #20466

Merged
merged 5 commits into from
Jan 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions packages/gatsby-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,29 @@ if (useJsonLogger) {
// Check if update is available
updateNotifier({ pkg }).notify({ isGlobal: true })

const MIN_NODE_VERSION = `>=8.0.0`
const MIN_NODE_VERSION = `8.0.0`

if (!semver.satisfies(process.version, MIN_NODE_VERSION)) {
if (!semver.satisfies(process.version, `>=${MIN_NODE_VERSION}`)) {
report.panic(
report.stripIndent(`
Gatsby requires Node.js v8 or higher (you have ${process.version}).
Gatsby requires Node.js ${MIN_NODE_VERSION} or higher (you have ${process.version}).
Upgrade Node to the latest stable release: https://gatsby.dev/upgrading-node-js
`)
)
}

const NEXT_MIN_NODE_VERSION = `10.13.0`

if (!semver.satisfies(process.version, NEXT_MIN_NODE_VERSION)) {
sidharthachatterjee marked this conversation as resolved.
Show resolved Hide resolved
report.warn(
report.stripIndent(`
Gatsby will be dropping support for Node.js ${process.version} soon
sidharthachatterjee marked this conversation as resolved.
Show resolved Hide resolved
and will only actively support ${NEXT_MIN_NODE_VERSION} or higher.
Please upgrade Node.js to a currently active LTS release: https://gatsby.dev/upgrading-node-js
sidharthachatterjee marked this conversation as resolved.
Show resolved Hide resolved
`)
)
}

process.on(`unhandledRejection`, reason => {
// This will exit the process in newer Node anyway so lets be consistent
// across versions and crash
Expand Down