Skip to content

npx react-native init AwesomeProject --version 0.57.3 doesnt work on ubuntu with nvm #1200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anderskitson opened this issue Jun 13, 2020 · 5 comments

Comments

@anderskitson
Copy link

I have run the following
npx react-native init AwesomeProject --version 0.57.3

and I get the following output

✔ Downloading template
✖ Copying template
error Error: Couldn't find the "/tmp/rncli-init-template-nSyXnK/node_modules/react-native/template.config.js file inside "react-native" template. Please make sure the template is valid. Read more: https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template

Without the version number it runs fine. I have tried just 0.57, 0.58, and 0.59 with the same result.
I never installed react native cli, just used npx. I am using nvm as my node version manager, and I am running node v12.18.0

Not sure how to solve this.

Thanks

@likern
Copy link

likern commented Oct 29, 2021

I have the same bug with npx react-native init App --template typescript command.

@liamjones
Copy link
Contributor

npx will be pulling the latest version of the CLI, that's only compatible with RN ^0.65: https://github.com/react-native-community/cli#compatibility

You could try an npx react-native@^1.0.0 but that's only compatible with ^0.59so won't help with 0.57 or 0.58.

If you're starting a new project I wouldn't recommend using a version of RN that's over two years old but I'm guessing you have a good reason for needing the old one rather than a current one.

@likern
Copy link

likern commented Nov 1, 2021

@liamjones Without setting version, on newest RN and cli it still fails with the same error. See this comment react-native-community/react-native-template-typescript#230 (comment)

@liamjones
Copy link
Contributor

@likern It's working fine here:

Screenshot 2021-11-01 at 13 56 35

Maybe take a look in the temp directory mentioned in your screenshot (if it still exists) and see if there's anything in there which might highlight why it's not working on your machine?

Maybe something to do with node version? My test which just worked was on 17.0.1 if that helps.

@github-actions
Copy link

There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants