2

I'm trying to create new react new app with typescript with the command

npx react-native init myApp --version 0.68.2 --template react-native-template-typescript

and I'm getting an error

error An unexpected error occurred: "https://registry.npm.taobao.org/react-native-template-react-native-template-typescript: [NOT_FOUND] react-native-template-react-native-template-typescript not found".

enter image description here

node version: v16.10.0

npm version:7.24.0

what I already tried to do

  • run with different way:

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

  • npm uninstall -g react-native-cli
  • npm i -g @react-native-community/cli
  • yarn remove global react-native-cli

nothing helped to solve this issue.

5
  • 1
    Looks like your custom NPM registry (registry.npm.taobao.org) doesn't have the template Commented Jul 4, 2022 at 23:55
  • how can I install this template? or what to do? Commented Jul 5, 2022 at 6:44
  • 1
    I'd talk to whoever is maintaining your custom registry to get it added. That or start using the default npm registry with npm set registry https://registry.npmjs.org/ Commented Jul 9, 2022 at 22:18
  • The requested URL is incorrect. It isn't a registry issue. The correct URL should be https://registry.npm.taobao.org/react-native-template-typescript. Change a registry WILL NOT be a solution. Commented Jul 10, 2022 at 2:41
  • Try upgrading node and npm ant then try to install cli globally. As -g option is deprecated, you should now install it like this, npm i --location=global @react-native-community/cli Commented Jul 10, 2022 at 3:26

3 Answers 3

2
+150

From the screenshot it seems like the template name is being picked up incorrectly for some reason

it should be looking for https://registry.npmmirror.com/react-native-template-typescript instead of https://registry.npmmirror.com/react-native-template-react-native-template-typescript

Can you try

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

Since the taobao npm has been moved to npmmirror. Reference

Sign up to request clarification or add additional context in comments.

Comments

1

Use:

$ npx react-native init MyApp --template react-native-template-typescript

(w/o a version tag)

Comments

-1

can you try this line

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

it should work to you

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.