Skip to content

Commit

Permalink
Exit with an error code when npm/yarn install fails (facebook#1224)
Browse files Browse the repository at this point in the history
Previously create-react-app exited with 0 after an installation error.
  • Loading branch information
fson authored and alexdriaguine committed Jan 23, 2017
1 parent 9bda36f commit fe7dbb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fe7dbb2

Please # to comment.