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
React Native init specific version
提问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
回答by Polygon
$ react-native init projectname --version 0.56.0
please check this guide
https://facebook.github.io/react-native/docs/getting-started
请查看本指南
https://facebook.github.io/react-native/docs/getting-started
回答by cutiko
Version and Template
版本和模板
Currently, I'm having problems with the 0.60.0
version 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 个不需要的副作用:
- devDependencies will be the latest but the dependencies will be the chosen, this will work anyway after...
- You will get a
react-native/libraries/NewAppScreen
error, go toApp.tsx
and replace all of that for something simple like a<View style={{flex:1,backgroundColor:'orange'}}>
so you can see it running
- devDependencies 将是最新的,但依赖项将被选择,这将在...
- 你会得到一个
react-native/libraries/NewAppScreen
错误,去把App.tsx
所有这些替换为简单的东西,比如 a<View style={{flex:1,backgroundColor:'orange'}}>
这样你就可以看到它正在运行
回答by MUSTAPHA GHLISSI
回答by Yeshan Jay
回答by aybars
npx react-native init YOURPROJECTNAME --version X.XX.X
npx react-native init YOURPROJECTNAME --version X.XX.X