Skip to content
Open
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
Prev Previous commit
feat(react-scripts): check Node.js version early in CLI (#5430)
  • Loading branch information
DipakHalkude committed Sep 23, 2025
commit b2a225366e7c5566f3c64d879d93f021894c82b7
14 changes: 14 additions & 0 deletions packages/react-scripts/bin/react-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@

'use strict';

// Check Node.js version early for clearer errors (see #5430)
const currentNodeVersion = process.versions.node;
const [major] = currentNodeVersion.split('.');
if (Number(major) < 14) {
console.error(
'You are running Node ' +
currentNodeVersion +
'.\n' +
'react-scripts requires Node 14 or higher. \n' +
'Please update your version of Node.'
);
process.exit(1);
}

// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
Expand Down