thecodingmachine / react-native-boilerplate

A React Native template for building solid applications 🐙, using JavaScript 💛 or Typescript 💙 (you choose).
https://thecodingmachine.github.io/react-native-boilerplate/
MIT License
4.75k stars 864 forks source link

[BUG]: Install specific version not work #355

Closed kangfredy closed 1 year ago

kangfredy commented 1 year ago

react-native environment setup

Description

I try to install react native with specific version i running using this command

npx react-native@0.69.3 init MyApp --template @thecodingmachine/react-native-boilerplate

but when i try to check package.json it's always using react native version 0.71.4 i need to downgrade because have issue for linter on visual studio code so i need this can dynamicly version

and i try different method

npx react-native init EasyHRApp --version 0.69.3 --template @thecodingmachine/react-native-boilerplate

but still same it's always using version 0.71.4

Version

Typescript Version

On which OS this issue appear on?

Desktop OS

Windows

JeremyDolle commented 1 year ago

Thanks for the report.

After checking in the documentation you could try:

npx react-native@0.69.3 init MyApp --version 0.69.3 --template @thecodingmachine/react-native-boilerplate

BUT! I don't think it's a good idea and I don't know if it will work (limitation of the react native cli). I said that because the boilerplate comes with code and dependencies which work perfectly for a specific version of react native (the latest possible). So by setting version 0.18 for exemple, you can't expect that the boilerplate will build successfully.

JeremyDolle commented 1 year ago

Yes I quickly search in the code of the cli and, in packages/cli/src/commands/init/init.ts, I see:

if (!!options.template && !!options.version) {
    throw new TemplateAndVersionError(options.template);
  }

So the cli is not made to accept twice of these options.