diff --git a/lib/lib.js b/lib/lib.js index 45a0907f..cfb87204 100644 --- a/lib/lib.js +++ b/lib/lib.js @@ -123,19 +123,19 @@ const generateWithNormalizedOptions = ({ const commandSync = execa.commandSync; if (generateExample) { - const reactNativeVersionCommand = 'react-native --version'; + const npxVersionCommand = 'npx --version'; const yarnVersionCommand = 'yarn --version'; const checkCliOptions = { stdio: 'inherit' }; - const errorRemedyMessage = 'both react-native-cli and yarn CLI tools are needed to generate example project'; + const errorRemedyMessage = 'both npx and yarn CLI tools are needed to generate example project'; try { - console.info('CREATE: Check for valid react-native-cli tool version, as needed to generate the example project'); - commandSync(reactNativeVersionCommand, checkCliOptions); - console.info(`${reactNativeVersionCommand} ok`); + console.info('CREATE: Check for valid npx version, as needed to generate the example project'); + commandSync(npxVersionCommand, checkCliOptions); + console.info(`${npxVersionCommand} ok`); } catch (e) { throw new Error( - `${reactNativeVersionCommand} failed; ${errorRemedyMessage}`); + `${npxVersionCommand} failed; ${errorRemedyMessage}`); } try { @@ -195,7 +195,7 @@ const generateWithNormalizedOptions = ({ const generateExampleApp = () => { const exampleReactNativeInitCommand = - `react-native init ${exampleName} --version ${exampleReactNativeVersion}`; + `npx react-native init ${exampleName} --version ${exampleReactNativeVersion}`; console.info( `CREATE example app with the following command: ${exampleReactNativeInitCommand}`);