为什么“本地模块不能为空"?导入博览会时发生错误? [英] Why does "Native module cannot be null" error occur when I import expo?

查看:61
本文介绍了为什么“本地模块不能为空"?导入博览会时发生错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用:

    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 App is created by command: react-native init

我同时使用了 react-native链接 react-native链接expo 命令

每当我这样导入expo时,都会出现问题

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

    import { Permissions } from 'expo';

    const Expo = require('expo');

我收到此错误:

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

BTW, I'm using mac

推荐答案

您是否在问题中查看了此解决方案

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

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

in some case reinstall node_modules, clear all caches could help

这篇关于为什么“本地模块不能为空"?导入博览会时发生错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆