为什么导入expo时出现"Native module cannot be null"错误?

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

我正在使用:

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

React Native App 是通过命令创建的:react-native init

而且我已经使用了 react-native linkreact-native link expo 命令

问题来了,每次导入expo都是这样

    import { Permissions } from 'expo';

    const Expo = require('expo');

我收到这个错误:

顺便说一句,我正在使用 mac

您是否在问题

中查看此解决方案

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

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

在某些情况下重新安装 node_modules,清除所有缓存可能会有帮助