reactjsreact-nativereact-native-windows

React Native doesn't install specific version 0.67 , but install 0.68(latest) version


When I try to start a project with a typescript template and specific version,for example: 0.67.4 doesn´t install this version, but install the latest version 0.68.

enter image description here

System:
OS: Windows 10 10.0.19044
CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
Memory: 2.12 GB / 11.87 GB
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD


Solution

  • The problem is that --template already uses a version, the one of the template, thus --version has no effect. You need to specify the correct typescript template version for the correct react-native version. For 0.67.X this is 6.9.* which is documented here.

    Thus, the following should work.

    npx react-native init RNCComponents --template react-native-template-typescript@6.9.6 
    

    Do not ask me why it is 6.9.6 rather than 6.9.4, but this one was 0.67.2 rather than 0.67.4.