在xcode上构建反应原生的iOS应用程序时出现此错误.
在npm install和rpm链接react-native-fs库之后开始出现此错误.但在网上搜索解决方案之后,我注意到许多人在安装其他反应本机库时遇到了同样的错误.
一个可能的解决方案,许多建议是,添加在"生成设置"下面- >"头搜索路径".
$(SRCROOT)/../node_modules/react-native/React - (递归)
但是这个解决方案没有运气,仍然得到同样的错误
我正在尝试执行以下代码:
exports.myFunction = function(){
myPromise.doThis().then(ret => {
return ret;
});
}
Run Code Online (Sandbox Code Playgroud)
调用此函数时,它返回undefined。我如何使函数等待承诺解决然后返回。
我第一次遇到这个问题:https://github.com/facebook/react-native/issues/10088
然后我按照这个解决方案解决了这个问题:https://github.com/facebook/react-native/issues/910#issuecomment-94181845
现在,当我进入npm start我得到[sane] Warning: Lost connection to watchman, reconnecting...有什么建议?
更新:当我将MacOS更新到MacOS Sierra时,就开始发生这种情况.