React-native-windows: Unrecognized Command "windows"

Created on 10 Jul 2019  路  8Comments  路  Source: microsoft/react-native-windows

I have the latest react native installed on my computer and followed these instructions to the letter, but I'm still getting the below error:

error Unrecognized command "windows".
info Run "react-native --help" to see a list of all available commands.

.NET

Most helpful comment

Hello -

Can you please check if the error still occurs if you try the following:

  1. Please use the version number like react-native init <project name> --version 0.58.0. Without the version number, you are probably picking up 0.60 which is not supported yet by react-native-windows current.

  2. cd into your react-native project before running react-native windows

  3. Ensure you have installed the plugin for windows:

npm install --save-dev rnpm-plugin-windows

All 8 comments

Hello -

Can you please check if the error still occurs if you try the following:

  1. Please use the version number like react-native init <project name> --version 0.58.0. Without the version number, you are probably picking up 0.60 which is not supported yet by react-native-windows current.

  2. cd into your react-native project before running react-native windows

  3. Ensure you have installed the plugin for windows:

npm install --save-dev rnpm-plugin-windows

Thanks @harinikmsft, its working

@hansenyy It's no longer saying command not found, but I'm getting a completely different error:

'C:\Users\\Desktop\Development\React-Native\R' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
(node:21220) UnhandledPromiseRejectionWarning: Error: Command failed: C:\Users\\Desktop\Development\React-Native\R&D\myapp\node_modules\react-native\local-cli\setup_env.bat
'C:\Users\\Desktop\Development\React-Native\R' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.

at checkExecSyncError (child_process.js:602:13)
at Object.execFileSync (child_process.js:622:13)
at Object.run (C:\Users\<user>\Desktop\Development\React-Native\R&D\myapp\node_modules\react-native\local-cli\cliEntry.js:146:16)
at <anonymous>

(node:21220) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:21220) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@harinikmsft to make sure she gets notified.

@harinikmsft I used 0.58 it runs but have the following output

Reactnative log.txt

@rozele - can you take a look?

To fix the following issue:

Make sure there is no & symbol in your project path.
Make sure your PC is in developer mode
Make sure you have all the UWP SDKs installed.

@J4s0nDRevs FYI, I got that error as well. Running npm install then react-native windows one more time fixed it for me.

Was this page helpful?
0 / 5 - 0 ratings