找不到react-native-jitsi-meet模块 [英] react-native-jitsi-meet module not found

查看:390
本文介绍了找不到react-native-jitsi-meet模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的react-native项目中安装Jitsi-Meet插件.我正在尝试在网站中创建视频/音频会议聚会功能,并且我想将react-native用于相同的目的.

I am trying to install Jitsi-Meet plugin in my react-native project. I am trying to create a video/audio conference meetup feature in a website and I want to use react-native for the same purpose.

这是插件链接. react-native-jitsi-meet-npmjs. org

插件已成功安装在package.json中

The plugin gets successfully installed in the package.json

但是当我尝试导入我的App.tsx文件时,它显示出我找不到模块

But when I am trying to import in my App.tsx file, it shows me module not found

如何成功导入插件?

谢谢.

推荐答案

1-缺少某些东西

丢失 index.js 文件,该文件对于npm packge是必需的.你可以在屏幕截图中看到

There is missing index.js file which is mendatory for npm packge. you can see in screenshot

-

2-您需要执行以下步骤来解决此程序包

第1步:

node_modules/react-native-jitsi-meet/index.js

第2步:

并将此代码添加到该index.js文件中

and this add code in that index.js file

import { NativeModules, requireNativeComponent } from 'react-native';

export const JitsiMeetView = requireNativeComponent('RNJitsiMeetView');
export const JitsiMeetModule = NativeModules.RNJitsiMeetView;
const call = JitsiMeetModule.call;
const audioCall = JitsiMeetModule.audioCall;
JitsiMeetModule.call = (url, userInfo) => {
  userInfo = userInfo || {};
  call(url, userInfo);
}
JitsiMeetModule.audioCall = (url, userInfo) => {
  userInfo = userInfo || {};
  audioCall(url, userInfo);
}
export default JitsiMeetModule;

完成这些步骤后,一切都会正常运行

after these steps everything will be working

节点:,当我们通过npmyarn

我们可以使用 patch-package 自动执行这些步骤

we can use patch-package to automate these steps

这篇关于找不到react-native-jitsi-meet模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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