[我在react-native-web应用程序中添加了Webrtc https://www.npmjs.com/package/react-native-webrtc模块。
我使用了npm i -s react-native-webrtc
命令。但是在创建构建时,我遇到以下错误:
错误:错误:无法从以下位置解析模块
react-native-webrtc
App.js
:在项目中找不到react-native-webrtc或 在以下目录中:node_modules如果您确定模块存在,请尝试以下步骤: 1.清除守望者手表:守望者手表全部 2.删除node_modules:rm -rf node_modules并运行yarn install 3.重置Metro的缓存:yarn start --reset-cache 4.删除缓存:rm -rf / tmp / metro- * 在ModuleResolver.resolveDependency(D:\ smartek_project \ video_conferencing \ newchanges \ VC_Frontend \ node_modules \ metro \ src \ node-haste \ DependencyGraph \ ModuleResolution.js:186:15) 在ResolutionRequest.resolveDependency(D:\ smartek_project \ video_conferencing \ newchanges \ VC_Frontend \ node_modules \ metro \ src \ node-haste \ DependencyGraph \ ResolutionRequest.js:52:18) 在DependencyGraph.resolveDependency(D:\ smartek_project \ video_conferencing \ newchanges \ VC_Frontend \ node_modules \ metro \ src \ node-haste \ DependencyGraph.js:287:16) 在Object.resolve(D:\ smartek_project \ video_conferencing \ newchanges \ VC_Frontend \ node_modules \ metro \ src \ lib \ transformHelpers.js:267:42) 在dependencies.map.result(D:\ smartek_project \ video_conferencing \ newchanges \ VC_Frontend \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:434:31) 在Array.map() 在resolveDependencies(D:\ smartek_project \ video_conferencing \ newchanges \ VC_Frontend \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:431:18) 在D:\ smartek_project \ video_conferencing \ newchanges \ VC_Frontend \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:275:33 在Generator.next() 在asyncGeneratorStep(D:\ smartek_project \ video_conferencing \ newchanges \ VC_Frontend \ node_modules \ metro \ src \ DeltaBundler \ traverseDependencies.js:87:24)
这是我的package.jsonDependenci
"dependencies": {
"@babel/polyfill": "^7.10.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/voice": "^1.1.4",
"@react-navigation/bottom-tabs": "^5.5.1",
"@react-navigation/native": "^5.5.0",
"@react-navigation/stack": "^5.4.1",
"babel-plugin-react-native-web": "^0.12.2",
"core-js": "^3.6.5",
"react": "16.11.0",
"react-dom": "^16.13.1",
"react-native": "^0.62.2",
"react-native-gesture-handler": "^1.6.1",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^3.0.2",
"react-native-screens": "^2.8.0",
"react-native-web": "^0.12.2",
"react-native-webrtc": "^1.75.3"
},