Environment
System:
OS: Windows 10 10.0.17763
CPU: (4) x64 Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
Memory: 610.45 MB / 7.90 GB
Binaries:
Node: 13.5.0 - C:\Program Files\Bins\node-v13.5.0-win-x64\node.EXE
Yarn: 1.20.0-20190930.1131 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.13.4 - C:\Program Files\Bins\node-v13.5.0-win-x64\npm.CMD
SDKs:
Android SDK:
API Levels: 22, 23, 26, 27, 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5977832
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
Description
new project using react-native-cli I came across an error:
: ReactNative: Running 'PROJECT_DIR \node_modules@react-native-community\cli\build\bin.js config' command failed.
FAILURE: Build failed with an exception.
Cannot run program "PROJECT_DIR\node_modules@react-native-community\cli\build\bin.js": CreateProcess error = 193,% 1 is not a valid Win32 application
As the error itself accuses. has a 'PROJECT_DIR\node_modules@react-native-community\cli-platform-android\native_modules.gradle' failure, when it attempts to run 'PROJECT_DIR\node_modules@react-native-community\cli\build\bin.js config' by Runtime.getRuntime().exec in .gradle
got a result by doing a jerry-rigged checking if the command being passed to
getCommandOutput (String command)
is the same as 'PROJECT_DIR\node_modules\@react-native-community\cli\build\bin.js config', and if true then the def cmdProcess variable would receive Runtime.getRuntime().exec ("node" + command)
cmdProcess = Runtime.getRuntime().exec ("node" + command)
if not by default Runtime.getRuntime().exec(command). At first it was a solution but nothing correct.
@react-native-community\cli-platform-android\native_modules.gradle line 154
In other words, when the command is being passed, it is not being executed with nodejs, but tried to execute the file by itself in the system.
I would like to report this.
Note: I apologize for the informality, it is the first time that I make an issue if I have a mistake I apologize and I will be listening to any comments.
def cmdProcess
if ( command.contentEquals( "PROJECT_DIR\\node_modules\\@react-native-community\\cli\\build\\bin.js config" ) ) cmdProcess = Runtime.getRuntime().exec( "node " + command )
else cmdProcess = Runtime.getRuntime().exec(command)
Note: I used google translate.
Reproducible Demo
react-native init --template typescript
yarn android
Environment
System:
OS: Windows 10 10.0.17763
CPU: (4) x64 Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
Memory: 610.45 MB / 7.90 GB
Binaries:
Node: 13.5.0 - C:\Program Files\Bins\node-v13.5.0-win-x64\node.EXE
Yarn: 1.20.0-20190930.1131 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.13.4 - C:\Program Files\Bins\node-v13.5.0-win-x64\npm.CMD
SDKs:
Android SDK:
API Levels: 22, 23, 26, 27, 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5977832
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
Description
new project using react-native-cli I came across an error:
: ReactNative: Running 'PROJECT_DIR \node_modules@react-native-community\cli\build\bin.js config' command failed.
FAILURE: Build failed with an exception.
Where:
Script 'PROJECT_DIR\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 160
What went wrong:
A problem occurred evaluating script.
As the error itself accuses. has a 'PROJECT_DIR\node_modules@react-native-community\cli-platform-android\native_modules.gradle' failure, when it attempts to run 'PROJECT_DIR\node_modules@react-native-community\cli\build\bin.js config' by Runtime.getRuntime().exec in .gradle
got a result by doing a jerry-rigged checking if the command being passed to
getCommandOutput (String command)is the same as 'PROJECT_DIR\node_modules\@react-native-community\cli\build\bin.js config', and if true then the
def cmdProcessvariable would receiveRuntime.getRuntime().exec ("node" + command)cmdProcess = Runtime.getRuntime().exec ("node" + command)if not by default
Runtime.getRuntime().exec(command). At first it was a solution but nothing correct.@react-native-community\cli-platform-android\native_modules.gradle line 154
In other words, when the command is being passed, it is not being executed with nodejs, but tried to execute the file by itself in the system.
I would like to report this.
Note: I apologize for the informality, it is the first time that I make an issue if I have a mistake I apologize and I will be listening to any comments.
Note: I used google translate.
Reproducible Demo
react-native init --template typescript
yarn android