无法在反应原生中要求Parse。 '要求未知模块"反应原生"'

时间:2016-08-31 00:56:32

标签: reactjs parse-platform react-native

我使用npm安装了以下内容:

"dependencies": {
    "parse": "^1.9.1",
    "react-native": "0.32.0",
    "react-native-admob": "^1.1.5",
    "react-redux": "4.4.5",
    "redux": "3.5.2"
  },

我无法通过使用:var Parse = require('parse/react-native')

将Parse引入我的本机反应应用程序

我收到此错误:

enter image description here

文件react-nativenode_modules/parse/react_native.js内,但我的应用程序找不到它。我尝试重置模拟器,删除并重新安装node_modules

错误现在已成为一个已知问题:Issue

1 个答案:

答案 0 :(得分:2)

解决方案:

内部文件node_modules/parse/lib/react-native/StorageController.react-native.js更改此行:

var _reactNative = require('react-native');

var _reactNative = require('../../../react-native');

这仍然是github中的一个悬而未决的问题:

这个解决方案是由@jaredwitt发现的 在:

  

https://github.com/ParsePlatform/Parse-SDK-JS/issues/342

     

我可以通过更改node_modules / parse / lib / react-native / StorageController.react-native.js中的以下行来修补它

相关问题