ios React Native init 特定版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35110363/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 08:23:15  来源:igfitidea点击:

React Native init specific version

iosreact-native

提问by Hasen

I upgraded my latest project to React Native 0.19 and instantly the video no longer works. How can I create a new project with a specific version? I want to init a new project at version 0.18.1. I did some google searches but couldn't find anything about this.

我将我的最新项目升级到 React Native 0.19 并且视频立即不再有效。如何创建具有特定版本的新项目?我想在 0.18.1 版本中初始化一个新项目。我做了一些谷歌搜索,但找不到任何关于此的信息。

$ react-native init newproject --verbose

I'm guessing I need to add the word @18.1 in there somewhere but can't get that to work.

我猜我需要在某处添加@18.1 这个词,但无法让它起作用。

回答by Bataleon

This should do the trick:

这应该可以解决问题:

$ react-native init newproject --version [email protected]

回答by Polygon

$ react-native init projectname --version 0.56.0 

please check this guide https://facebook.github.io/react-native/docs/getting-startedenter image description here

请查看本指南 https://facebook.github.io/react-native/docs/getting-started在此处输入图片说明

回答by cutiko

Version and Template

版本和模板

Currently, I'm having problems with the 0.60.0version so for doing this with version and typescript it goes like this:

目前,我遇到了0.60.0版本问题,因此使用版本和打字稿执行此操作时,它是这样的:

react-native init ProjectName --version="0.59.9" --template="typescript"

This has 2 unwanted side effects:

这有 2 个不需要的副作用:

  1. devDependencies will be the latest but the dependencies will be the chosen, this will work anyway after...
  2. You will get a react-native/libraries/NewAppScreenerror, go to App.tsxand replace all of that for something simple like a <View style={{flex:1,backgroundColor:'orange'}}>so you can see it running
  1. devDependencies 将是最新的,但依赖项将被选择,这将在...
  2. 你会得到一个react-native/libraries/NewAppScreen错误,去把App.tsx所有这些替换为简单的东西,比如 a<View style={{flex:1,backgroundColor:'orange'}}>这样你就可以看到它正在运行

回答by MUSTAPHA GHLISSI

You can do it like this:

你可以这样做:

react-native init YourProjectName --version X.XX.X

enter image description here

在此处输入图片说明

回答by Yeshan Jay

This seems to work.

这似乎有效。

react-native init --version="0.36.0" MyNewApp

react-native init --version="0.36.0" MyNewApp

Check the comment on this link:).

检查此链接上的评论:)。

回答by aybars

npx react-native init YOURPROJECTNAME --version X.XX.X

npx react-native init YOURPROJECTNAME --version X.XX.X