Skip to content

Commit

Permalink
fix(crwrsca): Check for Node >= 20.10.0 (#11544)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe authored and Josh-Walker-GM committed Sep 16, 2024
1 parent bbed254 commit 93f489a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/create-redwood-rsc-app/src/prerequisites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export function checkNodeVersion(config: Config) {
console.log('Running `node --version`')
}

// const { stdout: version } = spawnSync('node --version')
const result = spawnSync('node', ['--version'])

if (result.error) {
Expand All @@ -27,8 +26,11 @@ export function checkNodeVersion(config: Config) {
console.log('Node version:', version)
}

if (!semver.satisfies(version, '>=20')) {
console.error('❌Your Node.js version must be >=20')
// https://github.com/redwoodjs/redwood/issues/10492#issuecomment-2076063552
// The comment above and the one after explains why we check specifically
// for >= 20.10.0
if (!semver.satisfies(version, '>=20.10')) {
console.error('❌Your Node.js version must be >=20.10.0')
console.error('Please install or switch to a newer version of Node')
console.error(
'We recommend using a Node version manager like `fnm`, `nvm` or `n`',
Expand Down

0 comments on commit 93f489a

Please sign in to comment.