React Native init specific version

后端 未结 7 1428
陌清茗
陌清茗 2021-01-30 08:20

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 a

相关标签:
7条回答
  • 2021-01-30 08:45

    You can do it like this:

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

    0 讨论(0)
  • 2021-01-30 08:48
    $ react-native init projectname --version 0.56.0 
    

    please check this guide https://facebook.github.io/react-native/docs/getting-started

    0 讨论(0)
  • 2021-01-30 08:57

    This seems to work.

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

    Check the comment on this link :).

    0 讨论(0)
  • 2021-01-30 08:58

    react-native init newApp --version 0.62.0

    0 讨论(0)
  • 2021-01-30 08:59

    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:

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

    This has 2 unwanted side effects:

    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/NewAppScreen error, go to App.tsx and replace all of that for something simple like a <View style={{flex:1,backgroundColor:'orange'}}> so you can see it running
    0 讨论(0)
  • 2021-01-30 09:02

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

    0 讨论(0)
提交回复
热议问题