97

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 init newproject --verbose

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

3
  • 2
    You could use the initialized project, delete the node_modules, then go into the package.json file and specify the version you want, and run npm insall again. Jan 31, 2016 at 5:23
  • Ok thanks for your help.
    – Hasen
    Jan 31, 2016 at 7:59
  • 2
    I would not recommend this approach as there could be changes to the native Xcode and Android projects which won't get applied if you only change the React Native version in package.json
    – Bataleon
    Jun 5, 2019 at 14:19

11 Answers 11

223

This should do the trick:

$ react-native init newproject --version X.XX.X
3
  • 4
    @Polygon I agreed but it was added more than 1.5 years after my answer so I guess that's why it hasn't received as many upvotes.
    – Bataleon
    Jun 28, 2019 at 20:07
  • I wonder if it will rename the project as there is a name or it will simply and wrongly start off a new one with newproject name Jul 12, 2022 at 5:04
  • Add a link to the RN offical document
    – Wayne Mao
    Aug 24, 2022 at 9:51
42
$ react-native init projectname --version 0.56.0 

please check this guide https://reactnative.dev/docs/environment-setup enter image description here

2
  • 2
    This works with new versions now, and this is the standard method.
    – Polygon
    Dec 10, 2019 at 17:32
  • 1
    But it shows Need to install the following packages: [email protected]
    – Bagusflyer
    Mar 15, 2023 at 12:28
9

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
8
react-native init appname --version="0.63.4"
6

I have tried all the answers given in this post but most of them are not working So, I followed the official documentation, and here is the answer to this question:

npx [email protected] init ProjectNameHere --version X.XX.X

where X is your specific version.

1
  • 1
    this a better answer because the original answer doesn't include version after @ which was giving me issues. With that version specified everything works as expected: reactnative.dev/docs/next/…
    – Mando
    Aug 29, 2023 at 0:32
5

This seems to work.

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

Check the comment on this link :).

5

You can do it like this:

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

enter image description here

2

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

1

react-native init Yout_Project_Name --version 0.63.3

1

Run this:

npx [email protected] init ProjectName --version 0.72.1
-2

react-native init newApp --version 0.62.0

1
  • 1
    What does this add to the already existing answers?
    – Rayan Ral
    Jul 22, 2020 at 4:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.