4

I get several npm ERR! when trying to run : D:\React Native\cleanProject>npm run android npm ERR! missing script: android

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2019-03-26T08_39_44_164Z-debug.log

npm i

D:\React Native\cleanProject>npm run android npm ERR! missing script: android

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2019-03-26T08_39_44_164Z-debug.log

6 Answers 6

4

The command that you are trying to run is doesn't exist. Please try to run with this given below command.

react-native run-android
Sign up to request clarification or add additional context in comments.

3 Comments

'react-native' is not recognized as an internal or external command,
Do npm install in the project directory and then run again react-native run-android
error: unknown command 'run-android'
1

I think you need to run the following command for installing 'react-native' project to your Node JS first.

npm install react-native

After that, also make sure an emulator is started or cell phone is connected with developer mode.

And then retry by running

react-native run-android

to see if you can build and run the your application successfully.

Comments

0

check if your environment variable set properly.

In your PATH Variable:

C:\Users[Username]\AppData\Local\Android\Sdk\platform-tools C:\Users[Username]\AppData\Local\Android\Sdk\tools
C:\Program Files\nodejs

In your system Variable
ANDROID_HOME C:\Users[Username]\AppData\Local\Android\Sdk
JAVA_HOME C:\Program Files\Java\jdk1.8.0_191

Hope it works...

Comments

0

Follow this command, it works for me

npx react-native run-android

Comments

0

make sure you are in the root directory of your app before using react-native run-android

1- open your project and make sure you see the android rectory 2- in the address bar at the top type cmd and a new cmd will open at that location 3- type react-native run-android

I hope it helps

Comments

0

1- close every thing 2- go to folder where you created your app for example E:\Hasaan\rn 2\awesomeproject 3-now open the vs code from here and re run the command npm run android

the error is beacuse either the scrip inst availble in your packge.json folder if the script is availble the you aint running the command incorrect directory

enter image description here enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.