From e61176d650e2b5fe51dd6cd4c429ff47a1a9b1dc Mon Sep 17 00:00:00 2001 From: Elias Toivanen Date: Wed, 22 Aug 2018 20:23:43 -0700 Subject: [PATCH] Bugfix: Check NodeJS version successfully even for old runtimes (Fixes #20769) (#20779) Summary: Fixes #20769 Release notes -------------- [CLI] [BUGFIX] [local-cli/server/checkNodeVersion.js] - Disable auto-formatting in `local-cli/server/checkNodeVersion.js` since it introduces ES6 and ES7 syntax (trailing comma in argument list) which in turn makes ES5 engines crash with a `SyntaxError`. Pull Request resolved: https://github.com/facebook/react-native/pull/20779 Differential Revision: D9468346 Pulled By: hramos fbshipit-source-id: 24761a377a5fd104e11ed6b6e86da15e96a0e38b --- local-cli/server/checkNodeVersion.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/local-cli/server/checkNodeVersion.js b/local-cli/server/checkNodeVersion.js index cfc17dcf2..9fd026f17 100644 --- a/local-cli/server/checkNodeVersion.js +++ b/local-cli/server/checkNodeVersion.js @@ -4,7 +4,10 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @format + * Be mindful that this script may be run by legacy NodeJS runtimes. Keep this + * script ES5 compatible (e.g. do not insert the `@format` pragma here which + * may introduce non-ES5 compatible syntax.) + * */ 'use strict'; @@ -36,7 +39,7 @@ module.exports = function() { marginLeft: 1, marginRight: 1, paddingBottom: 1, - }), + }) ); process.exit(1); }