thoughtbot / suspenders

A Rails template with our standard defaults.
https://thoughtbot.com
MIT License
4.02k stars 528 forks source link

Prerequisites: Raise if Node version unsupported #1202

Closed stevepolitodesign closed 6 months ago

stevepolitodesign commented 6 months ago

Follow-up to #1201

It's not enough to ensure Node is installed. We also need to ensure the consumer has the supported minimum version installed. Otherwise, subsequent generators will raise errors like so:

error stylelint-config-standard-scss@13.1.0: The engine "node" is incompatible with this module. Expected version ">=18.12.0". Got "18.0.0"
error Found incompatible module.

We select v20.0.0 as our minimum supported version because it is slated for Active LTS, but is not bleeding edge at this time

We also raise when calling the template to avoid unnecessarily generating a new Rails application.