我目前正在开发一个带有 react native 的项目,该项目包含用于登录目的的 Auth0。当我尝试配置软件包时,它给了我这个错误:
Error: Missing NativeModule. Please make sure you run `react-native link react-native-auth0`
at Agent.newTransaction (agent.js:33)
at WebAuth.authorize (index.js:55)
at App (App.js:23)
at instantiate (createClassProxy.js:94)
at new App (eval at proxyClass (createClassProxy.js:112), <anonymous>:4:17)
at constructClassInstance (ReactNativeRenderer-dev.js:8871)
at updateClassComponent (ReactNativeRenderer-dev.js:11400)
at beginWork (ReactNativeRenderer-dev.js:12588)
at performUnitOfWork (ReactNativeRenderer-dev.js:15852)
at workLoop (ReactNativeRenderer-dev.js:15892)
我认为这是由于链接模块时出错,所以我手动做了,但没有任何变化。
可能,我迟到了。但将其发布以供将来参考。React Native CLI 提供了自动链接功能,该功能取代了命令 react-native link
。
对于 IOS,只需运行
cd ios && pod install && cd ..
https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#autolinking