React Native 报错综合处理

No bundle URL present

1
2
3
No bundle URL present
Make sure you’re running a packager server or have included a .jsbundle file in your application bundle

使用 ignite 脚手架构建时候出现此错误,目前可行的解决方法是:
1、删除 iOS/build 目录。
2、同时打开两个iterm 的窗口,一个在项目目录下执行 react-native start,另外一个执行 react-native run-ios即可。


React-native图片控件安装失败invalid tar file (react-native-web-maps…

rm -rf node_modules 之后 cnpm install 重新安装依赖时一直报错 invalid tar file (react-native-web-maps,拍查不到具体的报错原因。于是打开 Shadowsocks 的全局模式,改为使用 npm J进行安装,安装过程中清晰的提示了警告信息:

1
2
3
4
5
6
7
8
9
lottie-react-native@2.3.2 requires a peer of react-native@>=0.46 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps@7.3.0 requires a peer of react@15.5.4 but none is installed. You must install peer dependencies yourself.
npm WARN react-google-maps@7.3.0 requires a peer of react-dom@15.5.4 but none is installed. You must install peer dependencies yourself.
npm WARN react-native@0.44.3 requires a peer of react@16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-gesture-handler@1.0.0-alpha.41 requires a peer of react-native@>= 0.50.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-maps@0.21.0 requires a peer of react-native@^0.51 || ^0.52 || ^0.53 || ^0.54 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-svg@6.2.2 requires a peer of react-native@>=0.50.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-web-maps@0.1.0 requires a peer of react-native-web@* but none is installed. You must install peer dependencies yourself.
npm WARN react-prop-types-element-of-type@2.2.0 requires a peer of react@^0.14.6 || ^15.0.0-0 but none is installed. You must install peer dependencies yourself.

包的互相依赖版本存在问题,那就从这入手解决了。
如果后续版本过低在编译阶段模拟器也会进行报错提示:

总结一点:尽量使用npm,远离cnpm,的确会导致未知错误。

watchman 版本过低

1
2
3
4
5
6
11:25:24: Warning: You are using an old version of watchman (v4.5.0). This may cause problems for you.
11:25:24:
11:25:24: We recommend that you either uninstall watchman (and XDE will try to use a copy it is bundled with) or upgrade watchman to a newer version, at least v4.6.0.
11:25:24:
11:25:24: If you are using homebrew, try:
11:25:24: brew uninstall watchman; brew install watchman

但是查看watchman版本却是新版的4.9.0

还未找到解决方法,翻看官方文档去。