root-two / react-native-drawer

React Native Drawer
MIT License
2.54k stars 390 forks source link

Command "react-native" can not run after install react-native-drawer #306

Closed thanhdn1 closed 7 years ago

thanhdn1 commented 7 years ago

I inited React native project by:

react-native init MyShop

In MyShop folder, I install react-native-drawer:

npm install --save react-native-drawer

After install, I run project by:

react-native run-android

And get error "Command run-android unrecognized. Make sure that you have run npm install and that you are inside a react-native project." I checked react-native by command line

react-native -v

And get info:

react-native-cli: 2.0.1 react-native: n/a - not inside a React Native project directory

It seems react-native lib has been removed after installed react-native-drawer. My npm version:

E:\2.Projects\My\MyShop>npm -v 5.0.4

My node version:

E:\2.Projects\My\MyShop>node -v v8.1.2

Please help me re-procedure and fix it. Thank you!

thanhdn1 commented 7 years ago

I found out solution for this issue! I update npm to latest version: 5.1.0. Uninstall react-native-cli:

npm uninstall -g react-native-cli

Next, reinstall react-native-cli:

npm install -g react-native-cli

My issue has been fixed.