i have an Error on react-native: spawn cmd ENOENT - react-native

I'm developing a react-native app with expo cli but when i execute expo start appear this error:
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
already i reinstall expo cli
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject"
},
"dependencies": {
"expo": "^31.0.0",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0",
"expo-cli": "^2.7.0"
},
"private": true
}
i want to emulate this app in genymotion

Related

yarn android not working with react native

i´m running my react native app with bare workflow, and when i try to execute it with yarn android i get this error:
Could not read script 'C:\Users\claud\OneDrive\├?rea de Trabalho\teste\node_modules\expo\scripts\autolinking.gradle' as it does not exist.
package.json
{
"name": "teste",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~47.0.9",
"expo-splash-screen": "~0.17.5",
"expo-status-bar": "~1.4.2",
"react": "18.1.0",
"react-native": "0.70.5"
},
"devDependencies": {
"#babel/core": "^7.12.9"
},
"private": true
}
In my case it was because of yarn's new policy, "PnP"!
There's a perfect workaround here

React: Invariant Violation: "main" has not been registered

I created an app in React using the command expo init and now I am getting the following error. Any suggestions?
Invariant Violation: "main" has not been registered. This can happen if:
Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
A module failed to load due to an error and AppRegistry.registerComponent wasn't called.
For reference, this is my packages.json file:
{
"name": "bookshare",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#react-navigation/native": "^6.0.8",
"#react-navigation/native-stack": "^6.5.0",
"expo": "~44.0.0",
"expo-status-bar": "~1.2.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-safe-area-context": "^4.0.1",
"react-native-screens": "^3.12.0",
"react-native-web": "0.17.1"
},
"devDependencies": {
"#babel/core": "^7.12.9"
},
"private": true
}

I already installed babel core as a dependency but I keep getting error that it can't be found

I am trying to launch a small react-native project(done with expo) in web browser and I keep getting this error
Failed to compile.
C:/Users/SUPPORT/AppData/Roaming/npm/node_modules/expo-cli/node_modules/react-dev-utils/webpackHotDevClient.js
Error: [BABEL] C:\Users\SUPPORT\AppData\Roaming\npm\node_modules\expo-cli\node_modules\react-dev-utils\webpackHotDevClient.js: Cannot find module '#babel/core'
although I already installed babel and babel core
this is my package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"#expo-google-fonts/inter": "^0.1.0",
"#react-native-community/toolbar-android": "github:react-native-community/toolbar-android",
"expo": "~37.0.3",
"expo-font": "^8.2.1",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-paper": "^3.6.0",
"react-native-vector-icons": "^6.7.0",
"react-native-web": "^0.11.7"
},
"devDependencies": {
"#babel/core": "^7.10.4",
"#babel/preset-env": "^7.10.4",
"babel-loader": "^8.1.0",
"babel-preset-expo": "~8.1.0",
"webpack": "^4.43.0"
},
"private": true
}
project link:https://github.com/Mai9550/expo_template-react-native-
try to run
npm install #babel/core --save

SHA-1 for file .png (.png) is not computed (using Expo-CLI)

package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "^34.0.3",
"firebase": "^6.3.4",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
"react-native-elements": "^1.1.0",
"react-native-router-flux": "^4.0.6",
"react-native-web": "^0.11.4"
},
"devDependencies": {
"babel-preset-expo": "^6.0.0"
},
"private": true
}
App.json
"sdkVersion": "34.0.0",
"platforms": [
"ios",
"android",
"web"
],
how to resolve this as --reset-cache have no effect and Also the error is shown for that file which is not even the part of the project.
I also find same type of issue on stackoverflow here
but that is for react-native-cli in which upgrading react-native-cli resolved the issue.
I tried to upgrade expo-cli but nothing happen things remain the same.
I hope I am able to explain the issue
You can try expo start -c
It should be executed with the correct method of execution.

There is no QRCode on terminal when type npm start

I type command create-react-native-app <My package name>
then i type npm start i can see QRCode shows on my terminal
But when i type npm run eject for my project
I type npm start again. There's no QRCode show on my terminal any more.
I looking for some answer still can't fix it. It confused with me a lot.
Here is my environment:
Mac OS:10.13.4
{
"name": "TestMovie2",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-preset-react-native-stage-0": "^1.0.1",
"eslint-config-rallycoding": "^3.2.0",
"jest": "^22.4.3",
"jest-react-native": "^18.0.0",
"react-test-renderer": "16.3.0-alpha.1"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"#shoutem/animation": "^0.12.2",
"#shoutem/ui": "^0.23.4",
"react": "16.3.0-alpha.1",
"react-native": "0.54.0"
}
}
Hope you have solved the problem , but anyone still facing the problem can just type expo start instead of npm start