Why does “Native module cannot be null” error occur when I import expo?

会有一股神秘感。 提交于 2021-01-28 08:07:06

问题


I'm using:

    react-native-cli: 2.0.1
    react-native: 0.48.3
    npm: 4.6.1
    expo: 20.1.3

React Native App is created by command: react-native init

And I have used both react-native link and react-native link expo commands

Here comes the problem, every time I import expo like so

    import { Permissions } from 'expo';

Or

    const Expo = require('expo');

I get this error:

BTW, I'm using mac


回答1:


do you review this solution in the issues

https://github.com/zo0r/react-native-push-notification/issues/160

https://github.com/zo0r/react-native-push-notification/issues/279

in some case reinstall node_modules, clear all caches could help



来源:https://stackoverflow.com/questions/46186049/why-does-native-module-cannot-be-null-error-occur-when-i-import-expo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!