当第三个库不正确时,无法加载捆绑软件

时间:2018-07-23 07:59:14

标签: react-native

我使用create-react-native-app创建一个新项目,然后键入npm run eject使该应用程序成为纯本机应用程序。

然后我的步骤是:

1。npm install --save react-native-elements

2。react-native link react-native-vector-icons

但是当我只添加此代码时

import { Button } from 'react-native-elements';在我的App.js

运行它将显示如下错误: enter image description here

我检查终端是否显示错误:

error: bundling failed: Error: While trying to resolve module `react-native-elements` from file `/Users/huaweb/ReactNativeProject/Huaweb2/App.js`, the package `/Users/huaweb/ReactNativeProject/Huaweb2/node_modules/react-native-elements/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved (`/Users/huaweb/ReactNativeProject/Huaweb2/node_modules/react-native-elements/src/index.js`. Indeed, none of these files exist:

为什么我不能导入我的图书馆?我不知道。

任何帮助将不胜感激。预先感谢。

0 个答案:

没有答案