-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run-android failed 'C:\Program' is not recognized as an internal or external command #26921
Comments
Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety? 👉 Click here if you want to take another look at the Bug Report issue template. |
Can you run If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.
|
After some testing i was able to reproduce the Issue. The problem is your Node version is outdated. The requirement for React-Native is version 8.3 or newer. If you Update everything should be fine. But be careful because of this #26598 issue. The LTS version 10.16.3 should work fine. |
I had this problem and updating node to v12.13.0 LTS solved error. |
As @NyauIf mentioned, v12.13.0 LTS causes this error#26598. |
thank you for your answers. problem was nodejs and i tried to update node and i get "can't read property 'resolve'" error. so i used this page and fixed it. |
React Native Sucks I am unable to ran even a simple project please help , Error........................ info Running jetifier to migrate libraries to AndroidX. You can error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
|
Hi @shahbazhaider, yes your problem looks similar. Older NodeJs versions apparently have Problems with spaces in the path. Are you able to provide your NodeJs version with |
Hi Team, npx react-native info System: Error |
heloo bro same problem facing ...space in folder path |
please close this, this has nothing to do with react native You did not follow the instructions at https://reactnative.dev/docs/environment-setup and did not install correct node version Even if you did follow correct instructions, you stll had to open the issue in nodejs repository and not facebook/react-native |
info Starting JS server... Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Request blocked by Privoxy" error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. |
This is not fixable by using a specific Node Version, I'm going to try move my Node install to a path without a space.
|
Yeah, that did it, thank you @omidazm94 |
hy i have same issue.. how did you fix it |
On my case it was the space on the path name in the config file of node/npm.
|
hi, i'm facing this problem and its weird cause it happened when i created a new project with react-native init two days ago. i can run the old project but when i try to use command react-native run-android in the new project it gives me an error. and from the last few days every project that i build have a problem even if i build with Previous react-native versions, something comes like warnOnce and so on. is it something new that changed in react and react-native that cause these problems ?
please help me
#25936
(react-native info)
React Native version:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-2670QM CPU @ 2.20GHz
Memory: 4.21 GB / 7.95 GB
Binaries:
Node: 8.11.3 - C:\Program Files\nodejs\node.EXE
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 863 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
info Launching emulator...
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
FAILURE: Build failed with an exception.
The current character read is 'C' with an int value of 67
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js{ "root": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "reactNativePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native", "dependencies": {}, "commands": [ { "name": "log-ios", "description": "starts iOS device syslog tail" }, { "name": "run-ios", "description": "builds your app and starts it on iOS simulator", "examples": [ { "desc": "Run on a different simulator, e.g. iPhone 5", "cmd": "react-native run-ios --simulator "iPhone 5"" }, { "desc": "Pass a non-standard location of iOS directory", "cmd": "react-native run-ios --project-path "./app/ios"" }, { "desc": "Run on a connected device, e.g. Max's iPhone", "cmd": "react-native run-ios --device "Max's iPhone"" }, { "desc": "Run on the AppleTV simulator", "cmd": "react-native run-ios --simulator "Apple TV" --scheme "helloworld-tvOS"" } ], "options": [ { "name": "--simulator [string]", "description": "Explicitly set simulator to use. Optionally include iOS version betweenparenthesis at the end to match an exact version: "iPhone 6 (10.0)"", "default": "iPhone 11" }, { "name": "--configuration [string]", "description": "Explicitly set the scheme configuration to use", "default": "Debug" }, { "name": "--scheme [string]", "description": "Explicitly set Xcode scheme to use" }, { "name": "--project-path [string]", "description": "Path relative to project root where the Xcode project (.xcodeproj) lives.", "default": "ios" }, { "name": "--device [string]", "description": "Explicitly set device to use by name. The value is not required if you have a single device connected." }, { "name": "--udid [string]", "description": "Explicitly set device to use by udid" }, { "name": "--no-packager", "description": "Do not launch packager while building" }, { "name": "--verbose", "description": "Do not use xcpretty even if installed" }, { "name": "--port [number]", "default": 8081 }, { "name": "--terminal [string]", "description": "Launches the Metro Bundler in a new window using the specified terminal path." } ] }, { "name": "log-android", "description": "starts logkitty" }, { "name": "run-android", "description": "builds your app and starts it on a connected Android emulator or device", "options": [ { "name": "--root [string]", "description": "Override the root directory for the android build (which contains the android directory)", "default": "" }, { "name": "--variant [string]", "description": "Specify your app's build variant", "default": "debug" }, { "name": "--appFolder [string]", "description": "Specify a different application folder name for the android source. If not, we assume is "app"", "default": "app" }, { "name": "--appId [string]", "description": "Specify an applicationId to launch after build.", "default": "" }, { "name": "--appIdSuffix [string]", "description": "Specify an applicationIdSuffix to launch after build.", "default": "" }, { "name": "--main-activity [string]", "description": "Name of the activity to start", "default": "MainActivity" }, { "name": "--deviceId [string]", "description": "builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line)." }, { "name": "--no-packager", "description": "Do not launch packager while building" }, { "name": "--port [number]", "default": 8081 }, { "name": "--terminal [string]", "description": "Launches the Metro Bundler in a new window using the specified terminal path." }, { "name": "--tasks [list]", "description": "Run custom Gradle tasks. By default it's "installDebug"" }, { "name": "--no-jetifier", "description": "Do not run "jetifier" – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier.", "default": false } ] } ], "assets": [], "platforms": { "ios": {}, "android": {} }, "haste": { "providesModuleNodeModules": [ "react-native" ], "platforms": [ "ios", "android" ] }, "project": { "ios": { "sourceDir": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios", "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "pbxprojPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj\project.pbxproj", "podfile": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\Podfile", "podspecPath": null, "projectPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj", "projectName": "green26.xcodeproj", "libraryFolder": "Libraries", "sharedLibraries": [], "plist": [], "scriptPhases": [] }, "android": { "sourceDir": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app", "isFlat": false, "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "stringsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\res\values\strings.xml", "manifestPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\AndroidManifest.xml", "buildGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\build.gradle", "settingsGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\settings.gradle", "assetsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\assets", "mainFilePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\java\com\green26\MainApplication.java", "packageName": "com.green26" } }}
^
BUILD FAILED in 23s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
The current character read is 'C' with an int value of 67
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native\cli.js{ "root": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "reactNativePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules\react-native", "dependencies": {}, "commands": [ { "name": "log-ios", "description": "starts iOS device syslog tail" }, { "name": "run-ios", "description": "builds your app and starts it on iOS simulator", "examples": [ { "desc": "Run on a different simulator, e.g. iPhone 5", "cmd": "react-native run-ios --simulator "iPhone 5"" }, { "desc": "Pass a non-standard location of iOS directory", "cmd": "react-native run-ios --project-path "./app/ios"" }, { "desc": "Run on a connected device, e.g. Max's iPhone", "cmd": "react-native run-ios --device "Max's iPhone"" }, { "desc": "Run on the AppleTV simulator", "cmd": "react-native run-ios --simulator "Apple TV" --scheme "helloworld-tvOS"" } ], "options": [ { "name": "--simulator [string]", "description": "Explicitly set simulator to use. Optionally include iOS version betweenparenthesis at the end to match an exact version: "iPhone 6 (10.0)"", "default": "iPhone 11" }, { "name": "--configuration [string]", "description": "Explicitly set the scheme configuration to use", "default": "Debug" }, { "name": "--scheme [string]", "description": "Explicitly set Xcode scheme to use" }, { "name": "--project-path [string]", "description": "Path relative to project root where the Xcode project (.xcodeproj) lives.", "default": "ios" }, { "name": "--device [string]", "description": "Explicitly set device to use by name. The value is not required if you have a single device connected." }, { "name": "--udid [string]", "description": "Explicitly set device to use by udid" }, { "name": "--no-packager", "description": "Do not launch packager while building" }, { "name": "--verbose", "description": "Do not use xcpretty even if installed" }, { "name": "--port [number]", "default": 8081 }, { "name": "--terminal [string]", "description": "Launches the Metro Bundler in a new window using the specified terminal path." } ] }, { "name": "log-android", "description": "starts logkitty" }, { "name": "run-android", "description": "builds your app and starts it on a connected Android emulator or device", "options": [ { "name": "--root [string]", "description": "Override the root directory for the android build (which contains the android directory)", "default": "" }, { "name": "--variant [string]", "description": "Specify your app's build variant", "default": "debug" }, { "name": "--appFolder [string]", "description": "Specify a different application folder name for the android source. If not, we assume is "app"", "default": "app" }, { "name": "--appId [string]", "description": "Specify an applicationId to launch after build.", "default": "" }, { "name": "--appIdSuffix [string]", "description": "Specify an applicationIdSuffix to launch after build.", "default": "" }, { "name": "--main-activity [string]", "description": "Name of the activity to start", "default": "MainActivity" }, { "name": "--deviceId [string]", "description": "builds your app and starts it on a specific device/simulator with the given device id (listed by running "adb devices" on the command line)." }, { "name": "--no-packager", "description": "Do not launch packager while building" }, { "name": "--port [number]", "default": 8081 }, { "name": "--terminal [string]", "description": "Launches the Metro Bundler in a new window using the specified terminal path." }, { "name": "--tasks [list]", "description": "Run custom Gradle tasks. By default it's "installDebug"" }, { "name": "--no-jetifier", "description": "Do not run "jetifier" – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier.", "default": false } ] } ], "assets": [], "platforms": { "ios": {}, "android": {} }, "haste": { "providesModuleNodeModules": [ "react-native" ], "platforms": [ "ios", "android" ] }, "project": { "ios": { "sourceDir": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios", "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "pbxprojPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj\project.pbxproj", "podfile": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\Podfile", "podspecPath": null, "projectPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\ios\green26.xcodeproj", "projectName": "green26.xcodeproj", "libraryFolder": "Libraries", "sharedLibraries": [], "plist": [], "scriptPhases": [] }, "android": { "sourceDir": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app", "isFlat": false, "folder": "C:\Users\omidazm\Desktop\web\learning\react-native\green26", "stringsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\res\values\strings.xml", "manifestPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\AndroidManifest.xml", "buildGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\build.gradle", "settingsGradlePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\settings.gradle", "assetsPath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\assets", "mainFilePath": "C:\Users\omidazm\Desktop\web\learning\react-native\green26\android\app\src\main\java\com\green26\MainApplication.java", "packageName": "com.green26" } }}
^
BUILD FAILED in 23s
at checkExecSyncError (child_process.js:601:13)
at execFileSync (child_process.js:621:13)
at runOnAllDevices (C:\Users\omidazm\Desktop\web\learning\react-native\green26\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
Steps To Reproduce
1.react-native init project_name
2.react-native run-android
The text was updated successfully, but these errors were encountered: