diff --git a/packages/react-native/scripts/bundle.js b/packages/react-native/scripts/bundle.js index 83942879340a01..db46e58009de14 100644 --- a/packages/react-native/scripts/bundle.js +++ b/packages/react-native/scripts/bundle.js @@ -12,10 +12,13 @@ const {bundleCommand: bc} = require('@react-native/community-cli-plugin'); const {execSync} = require('child_process'); -const program = require('commander'); +const commander = require('commander'); const {readFileSync} = require('fs'); const path = require('path'); +// Commander 12.0.0 changes from the global to named export +const program = commander.program ?? commander; + program.version( JSON.parse( readFileSync(path.resolve(__dirname, '..', 'package.json'), 'utf8'),