Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native start的时候出错 #13

Closed
jianfengye opened this issue Sep 29, 2015 · 16 comments
Closed

react-native start的时候出错 #13

jianfengye opened this issue Sep 29, 2015 · 16 comments

Comments

@jianfengye
Copy link

git clone下来代码,进入root

➜  ZhiHuDaily-React-Native git:(master) npm install
➜  ZhiHuDaily-React-Native git:(master) react-native start
Command `start` unrecognized. Did you mean to run this inside a react-native project?

如何处理。。。

@race604
Copy link
Owner

race604 commented Sep 29, 2015

你好,开发环境都配置好了吗?

@jianfengye
Copy link
Author

开发环境都配置好了,我自己创建的AwsomeProject是可以运行起来的。

➜  AwesomeProject  react-native start
 ┌────────────────────────────────────────────────────────────────────────────┐
 │  Running packager on port 8081.                                            │
 │                                                                            │
 │  Keep this packager running while developing on any JS projects. Feel      │
 │  free to close this tab and run your own packager instance if you          │
 │  prefer.                                                                   │
 │                                                                            │
 │  https://github.com/facebook/react-native                                  │
 │                                                                            │
 └────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
   /Users/yejianfeng/Documents/baichebao/AwesomeProject


React packager ready.

[17:13:53] <START> Building Dependency Graph
[17:13:53] <START> Crawling File System
[17:13:54] <END>   Crawling File System (534ms)
[17:13:54] <START> Building in-memory fs for JavaScript
[17:13:55] <END>   Building in-memory fs for JavaScript (1135ms)
[17:13:55] <START> Building in-memory fs for Assets
[17:13:55] <END>   Building in-memory fs for Assets (591ms)
[17:13:55] <START> Building Haste Map
[17:13:56] <START> Building (deprecated) Asset Map
[17:13:56] <END>   Building (deprecated) Asset Map (308ms)
[17:13:56] <END>   Building Haste Map (822ms)
[17:13:56] <END>   Building Dependency Graph (3083ms)

@jianfengye
Copy link
Author

但是使用awsomeProject和ZhihuDaily项目的时候有一个不通就是npm的源不同

在跑ZhihuDaily项目的时候,我用的是淘宝的npm

http://blog.csdn.net/spy19881201/article/details/26943051

不知道这个有没有影响?

@race604
Copy link
Owner

race604 commented Sep 29, 2015

react-native run-android 呢?

@jianfengye
Copy link
Author

➜  ZhiHuDaily-React-Native git:(master) ✗ react-native run-android
Command `run-android` unrecognized. Did you mean to run this inside a react-native project?

@race604
Copy link
Owner

race604 commented Sep 29, 2015

This may help: facebook/react-native#2880

@jianfengye
Copy link
Author

真是。。。。看来是node_module的问题

@zzyyppqq
Copy link

zzyyppqq commented Dec 3, 2015

image

@zzyyppqq
Copy link

zzyyppqq commented Dec 3, 2015

image
是这个原因吗

@jorry
Copy link

jorry commented Feb 17, 2016

我也遇到这个问题,怎么解

@jiangqingbo
Copy link

运行 react-native run-android 之前先运行 npm install , 解决了这个问题。

@easternHong
Copy link

大神们,可以配置使用全局的node_modules吗,每一个工程目录下面都有一个node_modules文件夹,文件基本相同.

@chocoluffy
Copy link

@easternHong 配置全局通常是两种情况, 一个是给开发工具dev tool比如grunt, http-server, browser-sync等为的是开发的方便, 或者第二种接口的command line tool比如aws\react-native等等, 感觉大致上还是工具类的居多, 框架类的还是通过node_modules来安装更新, 毕竟npm install可以根据package.json规定的版本区间自动更新符合要求的版本号~个人感受哈, 欢迎补充!

@wenqin-231
Copy link

npm installl
react-native start
react-native run-android

@PayneJay
Copy link

npm installl
react-native start
react-native run-android
这三步之后完美的运行起来了,赞👍

@shenshizhong
Copy link

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_101\bin

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

这个错误怎么处理呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants