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

added check for typescript template and unsupported node version #7839

Merged
merged 2 commits into from
Oct 17, 2019
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
32 changes: 21 additions & 11 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,27 @@ function createApp(
useTypescript,
template
) {
const unSupportedNodeVersion = !semver.satisfies(process.version, '>=8.10.0');
awaseem marked this conversation as resolved.
Show resolved Hide resolved
if (unSupportedNodeVersion && useTypescript) {
console.log(
chalk.yellow(
`You are using Node ${process.version} with the TypeScript template. Since the old unsuporoted version of tools do not supported TypeScript, you will have to upgrade.\n\n` +
awaseem marked this conversation as resolved.
Show resolved Hide resolved
`Please update to Node 8.10 or higher for a better, fully supported experience.\n`
)
);

process.exit(1);
} else if (unSupportedNodeVersion) {
console.log(
chalk.yellow(
`You are using Node ${process.version} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
awaseem marked this conversation as resolved.
Show resolved Hide resolved
`Please update to Node 8.10 or higher for a better, fully supported experience.\n`
)
);
// Fall back to latest supported react-scripts on Node 4
version = '[email protected]';
}

const root = path.resolve(name);
const appName = path.basename(root);

Expand Down Expand Up @@ -222,17 +243,6 @@ function createApp(
process.exit(1);
}

if (!semver.satisfies(process.version, '>=8.10.0')) {
console.log(
chalk.yellow(
`You are using Node ${process.version} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
`Please update to Node 8.10 or higher for a better, fully supported experience.\n`
)
);
// Fall back to latest supported react-scripts on Node 4
version = '[email protected]';
}

if (!useYarn) {
const npmInfo = checkNpmVersion();
if (!npmInfo.hasMinNpm) {
Expand Down