Manspof
Manspof

Reputation: 357

unable to create react app with typescript

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

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

nothing helped to solve this issue.

Upvotes: 2

Views: 1253

Answers (3)

Raouf Satto
Raouf Satto

Reputation: 42

can you try this line

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

it should work to you

Upvotes: -1

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

Upvotes: 2

Connor Kuo
Connor Kuo

Reputation: 459

Use:

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

(w/o a version tag)

Upvotes: 1

Related Questions