微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法解析“ node_modules / react-native-svg / src / ReactNativeSVG.ts”中的“ ./LocalSvg”,尝试了我在网上找到的所有内容

如何解决无法解析“ node_modules / react-native-svg / src / ReactNativeSVG.ts”中的“ ./LocalSvg”,尝试了我在网上找到的所有内容

我正在用expo构建React本机应用程序,但是我遇到了svg问题。我使用svg是因为我使用的是胜利图表中的图表,但是当我尝试构建时,出现标题中指出的错误 Unable to resolve "./LocalSvg" from "node_modules/react-native-svg/src/ReactNativeSVG.ts" 我已经尝试了所有在线发现的内容删除特定的节点模块并重新安装,链接svg,重新安装所有节点模块)都无济于事。这是我的package.json

{
  "main": "node_modules/expo/AppEntry.js","scripts": {
    "start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web","eject": "expo eject"
  },"dependencies": {
    "@react-native-community/masked-view": "^0.1.6","axios": "^0.19.2","expo": "~37.0.3","expo-constants": "~9.0.0","expo-image-picker": "~8.1.0","react": "~16.9.0","react-dom": "~16.9.0","react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz","react-native-elements": "^2.0.1","react-native-gesture-handler": "~1.6.0","react-native-image-picker": "^2.3.1","react-native-maps": "0.26.1","react-native-reanimated": "~1.7.0","react-native-safe-area-context": "0.7.3","react-native-screens": "~2.2.0","react-native-svg": "^11.0.1","react-native-web": "~0.11.7","react-navigation": "^4.4.0","react-navigation-stack": "^2.5.1","react-navigation-tabs": "^2.8.13","victory-native": "^35.0.1"
  },"devDependencies": {
    "babel-preset-expo": "~8.1.0","@babel/core": "^7.8.6"
  },"private": true
}

Here is a picture of the error on my phone as it shows more detail

这在android和ios上都在发生。 想知道是否有人可以帮助我解决此问题, 谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。