2

I get this error when try and run react native on my emulator, react-native run-android

error Unrecognized command "run-android".

My emulator is connected and working, any ideas?

Package.json:

{
  "name": "iaapp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "name": "Inovative Anatomy",
    "flow": "flow",
    "test": "node ./node_modules/jest/bin/jest.js --watchAll"
  },
  "dependencies": {
    "@babel/plugin-proposal-decorators": "^7.4.4",
    "@react-native-community/async-storage": "^1.6.1",
    "react": "16.8.5",
    "react-dom": "^16.8.6",
    "react-native": "0.59.10",
    "react-native-circular-progress": "^1.1.0",
    "react-native-component-fade": "^1.0.2",
    "react-native-elements": "^1.1.0",
    "react-native-fade": "^1.0.3",
    "react-native-fade-in-view": "^1.0.5",
    "react-native-gesture-handler": "^1.3.0",
    "react-native-responsive-image": "^2.3.1",
    "react-native-share": "^1.2.1",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^9.5.1",
    "react-native-vector-icons": "^6.6.0",
    "react-native-view-shot": "^2.6.0",
    "react-native-webview": "^5.12.1",
    "react-native-webview-bridge": "^0.40.1",
    "react-navigation": "^3.0.9",
    "react-navigation-backhandler": "^1.3.2",
    "react-navigation-transitions": "^1.0.11",
    "react-redux": "^6.0.1",
    "redux": "^4.0.1",
    "redux-persist": "^5.10.0",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/cli": "^7.5.5",
    "@babel/core": "^7.5.5",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^0.0.7",
    "@types/jest": "^24.0.18",
    "@types/react": "^16.9.2",
    "@types/react-native": "^0.60.14",
    "@types/react-redux": "^7.1.7",
    "@types/react-test-renderer": "^16.9.0",
    "@types/redux-logger": "^3.0.7",
    "@types/redux-persist": "^4.3.1",
    "babel-jest": "^24.1.0",
    "eslint": "^6.8.0",
    "jest": "^24.1.0",
    "metro-react-native-babel-preset": "0.54.1",
    "prettier": "^1.18.2",
    "react-native-dotenv": "^0.2.0",
    "react-test-renderer": "16.8.6",
    "redux-logger": "^3.0.6",
    "tslint-react": "^4.2.0",
    "typescript": "^3.6.3"
  },
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
  }
}
1

4 Answers 4

5

I had this issue for a few minutes until I realized I was running the command in the wrong directory...

I'm putting this here in hopes that this will help some future dev from making a similar, simple, mistake.

Sign up to request clarification or add additional context in comments.

2 Comments

What is the wrong directory? The right one?
The correct directory is the root of the project. The wrong directory is any other location
0

try npx react-native run-android

1 Comment

you probably using @react-native-community/cli, please check github.com/react-native-community/cli#about
0

You have to update your npm version... Use this command and try again...

npm install npm@latest -g

credits here

Comments

0

if npx react-native run-android is not working goto package.json file and look over "scripts" debugger is there. clicking on debugger gives you options on top of the screen. select react-native run-android.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.