Skip to content
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

Yarn appears to be fetching for a wrong repository : https://registry.yarnpkg.com/react-native-template-react-native-template-typescript #97

Closed
jarodevs opened this issue Oct 31, 2019 · 10 comments

Comments

@jarodevs
Copy link

jarodevs commented Oct 31, 2019

Bug

Initializing a projet with command :
npx react-native init project --template react-native-template-typescript
Returns an error:

error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found".

Environment info

react-native version: 0.61.3
CLI: @react-native-community/cli
yarn: 1.19.1

@radko93
Copy link
Collaborator

radko93 commented Oct 31, 2019

Are you sure you are running the latest CLI version? Seems like you still have the old one installed. try running with npx --ignore-existing flag.

@zmnv
Copy link

zmnv commented Oct 31, 2019

@Mnjaro

I have the same issue. But I fix it by:

  1. Install latest cli version (now 2.9.0)
yarn global add @react-native-community/cli
npx react-native init MyApp --template react-native-template-typescript

In new version of cli you can see ASCII React logo

@danibram
Copy link

Yes, I had to do this, with npx doesnt work for me.

npm i --global @react-native-community/cli
react-native init MyApp --template react-native-template-typescript

Thanks

@zmnv
Copy link

zmnv commented Oct 31, 2019

@danibram

Can you tell your current npm version? It's latest?

@danibram
Copy link

danibram commented Nov 1, 2019

@danibram

Can you tell your current npm version? It's latest?

npm v6.10.0
node v12.7.0

The latest is 6.12.0, but mine is near...

@jarodevs
Copy link
Author

jarodevs commented Nov 4, 2019

Sorry for the delay on the answer. It appears I didn't have the latest version of the CLI tool. The problem was that the old cli wasn't correctly removed. Thanks for the help.

@jarodevs jarodevs closed this as completed Nov 4, 2019
@omairvaiyani
Copy link

Went through the same problem - worth adding this to README faqs?

@carlosstenzel
Copy link

Can you try adding the --ignore-existing flag

npx --ignore-existing react-native init MyApp --template react-native-template-typescript

@carlosstenzel
Copy link

carlosstenzel commented Jun 28, 2020

Best solution I found

Remove

npm uninstall -g react-native-cli

Create the folder where the project will be

mkdir [folder name] && cd [folder name]

Install the dependencies and everything will work

yarn init
yarn add react-native
yarn react-native init [Project Name] ...

@mk1020
Copy link

mk1020 commented Jan 13, 2021

Try update yarn.
Run curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
It helped me

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

No branches or pull requests

7 participants