Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 如何将NativeBase 2.2.0导入到本机项目?_React Native_React Native Android_React Native Ios_Native Base - Fatal编程技术网

React native 如何将NativeBase 2.2.0导入到本机项目?

React native 如何将NativeBase 2.2.0导入到本机项目?,react-native,react-native-android,react-native-ios,native-base,React Native,React Native Android,React Native Ios,Native Base,我是ReactNative开发的新手,我正在尝试将NativeBase 2.2.0导入到我的项目中。我遵循这个指示 步骤: 在手机上成功安装应用程序后,我尝试安装NativeBase $npm install native-base --save 土生土长的-base@2.3.3postinstall\MyProject e\u模块\native base 节点addEjectScript.js ┌───────────────────────────────────────────────

我是ReactNative开发的新手,我正在尝试将NativeBase 2.2.0导入到我的项目中。我遵循这个指示

步骤:

在手机上成功安装应用程序后,我尝试安装NativeBase

$npm install native-base --save
土生土长的-base@2.3.3postinstall\MyProject e\u模块\native base 节点addEjectScript.js

┌─────────────────────────────────────────────────────────────────────────── ─────────────┐ │ NativeBase 2.0已成功安装! │ │ 运行node node_modules/native base/ejectTheme.js复制主题配置变量。│ │ 去看医生 有关如何更改血红素的详细信息。│ └─────────────────────────────────────────────────────────────────────────── ─────────────┘ npm通知创建了一个锁文件,名为package-lock.json。你 你应该犯下这个错误

npm警告本机-base@2.3.3需要react@>=16.0.0-alpha.3的对等方 但未安装。您必须自己安装对等依赖项。npm 警告本地人-base@2.3.3需要react native@>=0.46.0的对等方,但 没有安装。您必须自己安装对等依赖项。npm警告 天然碱-theme@0.2.1需要反应本机@>=0的对等方 但没有安装。您必须自己安装对等依赖项。 npm警告本机基站-theme@0.2.1需要一个同龄人 react@>=16.0.0-a.3,但未安装。您必须安装对等计算机 你自己

土生土长的-base@2.3.3在78.962s中添加了22个包,删除了625个包,更新了91个包 但当我进入安装对等依赖项步骤时,我发现了一个错误

$react-native link
无法识别命令链接。确保已运行npm安装 你在一个react本地项目中

然后我尝试:

 $npm install react
    npm WARN react-native@0.49.5 requires a peer of react@16.0.0-beta.5 but none is installed. You must install peer dependencies yourself.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    react@16.0.0 added 115 packages, removed 15 packages and updated 1 package in 20.176s


 $npm install react-native
    npm WARN deprecated connect@2.30.2: connect 2.x series is deprecated
npm WARN react-native@0.49.5 requires a peer of react@16.0.0-beta.5 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ react-native@0.49.5
added 115 packages, removed 15 packages and updated 1 package in 189.374s

$react-native link
 Scanning folders for symlinks in ..\ReactNative\MyAsset\node_modules (40ms)
rnpm-install info Linking assets to ios project
rnpm-install info Linking assets to android project
rnpm-install info Assets have been successfully linked to your project
我在尝试安装应用程序时出错

 $react-native run-android
       React packager ready.
    Loading dependency graph, done.
    Bundling `index.js`  [development, non-minified]  0.0% (0/418), failed.
    error: bundling failed: Error: Cannot find module 'AccessibilityInfo' (While processing preset: "MyProject\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js")
        at Function.Module._resolveFilename (module.js:527:15)
        at Function.Module._load (module.js:476:23)
        at Module.require (module.js:568:17)
        at require (internal/module.js:11:18)
        at Object.get AccessibilityInfo [as AccessibilityInfo] (MyProject\node_modules\react-native\Libraries\react-native\react-native-implementation.js:19:36)
        at MyProject\node_modules\babel-core\node_modules\lodash\_baseClone.js:145:23
        at arrayEach (MyProject\node_modules\babel-core\node_modules\lodash\_arrayEach.js:15:9)
        at baseClone (MyProject\node_modules\babel-core\node_modules\lodash\_baseClone.js:142:3)
        at cloneDeepWith (MyProject\node_modules\babel-core\node_modules\lodash\cloneDeepWith.js:37:10)
环境 -节点版本 v6.11.5 -反应本机版本 react本机cli:2.0.1 反应本机:不适用-不在反应本机项目目录内 -npm-版本 5.5.1

我是做错了什么还是遗漏了什么? 有人能帮忙吗?
谢谢

本地-base@2.3.3在78.962s中添加了22个包,删除了625个包,更新了91个包

这很奇怪。我正在与native base合作,但之前没有看到这一点

再次安装本机base后运行npm安装

如果不起作用,请运行npm install react和npm install react native


它应该可以工作。

我按照您所说的步骤成功安装了应用程序。但我在尝试“反应本地链接”时仍然会出错。我已经坚持了几天。请检查您的node_modules/react/package.json和node_modules/react native/package.json,并让我知道这些包的版本。在“react native链接”工作之后,我尝试了“npm install react”和“npm install react native”。但是当我尝试“react native run android”时,我得到了错误==>{Bundling index.js[development,non-minified]0.0%0/418,失败。错误:捆绑失败:错误:在处理预设时找不到模块“AccessibilityInfo”:MyProject\\node\u modules\\react native\\Libraries\\react nat‌​ive\\react native im‌​plementation.js}。我编辑了我的问题。安装react-native后,请尝试react-native升级,然后运行react-native,谢谢。androidAnyone可以提供帮助。我仍然坚持这一点。这让我很生气。配置环境似乎很复杂,对吗?
 $react-native run-android
       React packager ready.
    Loading dependency graph, done.
    Bundling `index.js`  [development, non-minified]  0.0% (0/418), failed.
    error: bundling failed: Error: Cannot find module 'AccessibilityInfo' (While processing preset: "MyProject\\node_modules\\react-native\\Libraries\\react-native\\react-native-implementation.js")
        at Function.Module._resolveFilename (module.js:527:15)
        at Function.Module._load (module.js:476:23)
        at Module.require (module.js:568:17)
        at require (internal/module.js:11:18)
        at Object.get AccessibilityInfo [as AccessibilityInfo] (MyProject\node_modules\react-native\Libraries\react-native\react-native-implementation.js:19:36)
        at MyProject\node_modules\babel-core\node_modules\lodash\_baseClone.js:145:23
        at arrayEach (MyProject\node_modules\babel-core\node_modules\lodash\_arrayEach.js:15:9)
        at baseClone (MyProject\node_modules\babel-core\node_modules\lodash\_baseClone.js:142:3)
        at cloneDeepWith (MyProject\node_modules\babel-core\node_modules\lodash\cloneDeepWith.js:37:10)