【发布时间】:2017-09-29 10:58:46
【问题描述】:
我正在使用 React Native 构建一个应用,但出现了这个错误。
我尝试清除缓存并再次安装包,但仍然有问题。
这是来自终端的错误信息。
UnhandledPromiseRejectionWarning:未处理的承诺拒绝 (拒绝 id:2):UnableToResolveError:无法解析模块
./node_modules/react-native/packager/src/components来自/Users/andy/Downloads/testapp/index.ios.js: 目录 /Users/andy/Downloads/testapp/node_modules/react-native/packager/src/components 不存在
谁能帮帮我?
【问题讨论】:
-
你的系统中是否存在这个路径“/Users/andy/Downloads/testapp/node_modules/react-native/packager/src/components”?
-
找不到,怎么添加?
-
如果不存在就不用添加了。请尝试更改相对路径。您是否尝试在 index.ios.js 中导入某些内容?
-
import { AppRegistry } from 'react-native' import { Root } from 'app/components' AppRegistry.registerComponent('autospa', () => Root)
-
这是index.ios.js的内容。
标签: ios npm react-native npm-install react-native-ios