React Native:无法识别命令`run-ios` [英] React Native: Command `run-ios` unrecognized

查看:41
本文介绍了React Native:无法识别命令`run-ios`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个不同的 ReactNative 项目:

I have two different ReactNative-Projects:

  • a) 2016 年 1 月的一个项目
  • b) 一个全新的 react-native 项目从现在开始(2016 年 3 月 20 日)

在新项目中,react-native 的 cli 工具包含命令run-ios"和接下来的两个run-android",但在 2016 年 1 月的旧项目中没有.在旧项目中没有run-ios"命令可用:

Within the new project the cli tool of react-native contains the command "run-ios" next two "run-android", but not on the older project from januar 2016. On the older one there is not "run-ios" command available:

$ react-native run-ios
Command `run-ios` unrecognized
Usage: react-native <command>

我已经运行了react-native upgrade",没有任何问题.

I already ran "react-native upgrade" without any issues.

如何在较旧的项目中也获得命令run-ios"?

How can i get the command "run-ios" also in older projects?

推荐答案

只需使用以下命令更新项目中的 react native 版本:

Just update the version of react native in your project with the following command:

$> npm install --save react-native@latest

这篇关于React Native:无法识别命令`run-ios`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆