Skip to content

Commit 0990ce0

Browse files
authored
Exit with an error code when npm/yarn install fails (#1224)
Previously create-react-app exited with 0 after an installation error.
1 parent 2e02e36 commit 0990ce0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/create-react-app/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ function run(root, appName, version, verbose, originalDirectory) {
142142
var packageToInstall = getInstallPackage(version);
143143
var packageName = getPackageName(packageToInstall);
144144

145-
install(packageToInstall, verbose, function (code, command, args) {
145+
install(packageToInstall, verbose, function(code, command, args) {
146146
if (code !== 0) {
147147
console.error('`' + command + ' ' + args.join(' ') + '` failed');
148-
return;
148+
process.exit(1);
149149
}
150150

151151
checkNodeVersion(packageName);

0 commit comments

Comments
 (0)