From 469dbf11ae86ca67134764ff9635f6b7eb887990 Mon Sep 17 00:00:00 2001 From: Ville Immonen Date: Sat, 10 Dec 2016 03:54:14 +0200 Subject: [PATCH] Exit with an error code when npm/yarn install fails (#1224) Previously create-react-app exited with 0 after an installation error. --- packages/create-react-app/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/create-react-app/index.js b/packages/create-react-app/index.js index e6295ec519c..0fb61d60f1d 100644 --- a/packages/create-react-app/index.js +++ b/packages/create-react-app/index.js @@ -142,10 +142,10 @@ function run(root, appName, version, verbose, originalDirectory) { var packageToInstall = getInstallPackage(version); var packageName = getPackageName(packageToInstall); - install(packageToInstall, verbose, function (code, command, args) { + install(packageToInstall, verbose, function(code, command, args) { if (code !== 0) { console.error('`' + command + ' ' + args.join(' ') + '` failed'); - return; + process.exit(1); } checkNodeVersion(packageName);