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

fix(CRWA): make node and yarn compatibility checks fail #8128

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Changes from all commits
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
35 changes: 10 additions & 25 deletions packages/create-redwood-app/src/create-redwood-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function executeCompatibilityCheck(templateDir, yarnInstall) {
.filter((name) => !result.versions[name].isSatisfied)
.map((name) => {
const { version, wanted } = result.versions[name]
return `${name} ${wanted} required, but you have ${version}`
return `${name} ${wanted} required; found ${version}`
})
return resolve([false, logStatements])
})
Expand All @@ -89,37 +89,22 @@ async function executeCompatibilityCheck(templateDir, yarnInstall) {

if (!engineCheckPassed) {
tui.stopReactive(true)
const engineCheckErrorDocs = terminalLink(
'Tutorial - Prerequisites',
'https://redwoodjs.com/docs/tutorial/chapter1/prerequisites'
)
tui.displayError(
'Compatibility checks failed',
[
` ${engineCheckErrors.join('\n')}`,
'',
` This may make your project incompatible with some deploy targets.`,
` See: ${engineCheckErrorDocs}`,
` Please use tools like nvm or corepack to change to a compatible version.`,
` See: ${terminalLink(
'Tutorial - Prerequisites',
'https://redwoodjs.com/docs/tutorial/chapter1/prerequisites'
)}`,
].join('\n')
)
try {
const response = await tui.prompt({
type: 'select',
name: 'override-engine-error',
message: 'How would you like to proceed?',
choices: ['Override error and continue install', 'Quit install'],
initial: 0,
})
if (response['override-engine-error'] === 'Quit install') {
recordErrorViaTelemetry('User quit after engine check error')
await shutdownTelemetry()
process.exit(1) // TODO: Should we use a different exit code?
}
} catch (error) {
recordErrorViaTelemetry('User cancelled install at engine check error')
await shutdownTelemetry()
process.exit(1)
}

recordErrorViaTelemetry('Compatibility checks failed')
await shutdownTelemetry()
process.exit(1)
}
}

Expand Down