【问题标题】:Vue Native installation failed with Vue Native CLI使用 Vue Native CLI 安装 Vue Native 失败
【发布时间】:2019-04-13 07:54:24
【问题描述】:

创建helloworld项目参考https://vue-native.io/docs/installation.html#Setup-with-Vue-Native-Cli

但是有以下错误,我的第一个应用程序没有启动。

Unable to resolve "../../App" from "node_modules/expo/AppEntry.js"

我的环境

$ node -v
v9.9.0
$ npm -v
6.4.1

$ npm list --depth=0
empty-project-template@ /Users/kamo/repo/github.com/kamontia/vue- 
native-app/helloworld
├── babel-preset-expo@5.0.0
├── expo@31.0.4
├── react@16.5.0
├── react-native@0.57.1
├── vue-native-core@0.0.8
├── vue-native-helper@0.0.9
└── vue-native-scripts@0.0.14

npm ERR! peer dep missing: react@16.0.0-alpha.6, required by react- 
native-reanimated@1.0.0-alpha.10
npm ERR! peer dep missing: react-native@^0.44.1, required by react- 
native-reanimated@1.0.0-alpha.10

在模拟器上,

Unable to resolve module ../../App from  
xxx/node_modules/expo/AppEntery.js: The ./../App could not be found 
from ...
Indeed, none of these files exist:
* ... App(.native||.ios.js|...

我该怎么办?

我也试过用React Native创建项目参考https://vue-native.io/docs/installation.html#Setup-with-React-Native,成功启动应用。

【问题讨论】:

  • 你能解决这个问题吗?我现在遇到了这个问题,这让我很生气。

标签: vue.js vue-native


【解决方案1】:

有同样的问题。下面对我有用

app.json添加

"sourceExts": [ "js", "json", "ts", "tsx", "jsx", "vue"]
Inside
"packagerOpts"



"packagerOpts": 
{ "sourceExts": [ "js", "json", "ts", "tsx", "jsx", "vue"],
 "config": "metro.config.js" }

发件人:https://github.com/GeekyAnts/vue-native-core/issues/117

这对我有用

【讨论】:

  • 非常感谢!它就像一个魅力。很奇怪,为什么 vue-native 的核心开发者没有从盒子里添加它。
猜你喜欢
  • 1970-01-01
  • 2019-12-17
  • 2020-04-20
  • 1970-01-01
  • 2019-12-30
  • 2021-05-20
  • 2021-06-17
  • 1970-01-01
  • 2021-02-13
相关资源
最近更新 更多