question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npx react-native init MyApp --template react-native-template-typescript does not work correctly

See original GitHub issue

Bug

Environment info

React native info output:

System:
    OS: macOS 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 1.15 GB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.6.0 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
    Android SDK:
      API Levels: 23, 25, 26, 27, 28
      Build Tools: 23.0.1, 23.0.3, 25.0.1, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3
      System Images: android-27 | Google APIs Intel x86 Atom
      Android NDK: 19.2.5345600
  IDEs:
    Android Studio: 3.1 AI-173.4907809
    Xcode: 10.3/10G8 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.5 => 0.60.5 
  npmGlobalPackages:
    create-react-native-app: 1.0.0
    react-native-cli: 2.0.1
    react-native-git-upgrade: 0.2.7

Library version: x.x.x

Steps To Reproduce

  1. After running command npx react-native init MyApp --template react-native-template-typescript I get below error in terminal Screenshot 2019-09-12 at 6 27 53 PM The installer is looking for package react-native-template-react-native-template-typescript which is not available.

  1. After removing react-native-template- & running command npx react-native init MyApp --template typescript I get below folder structure which is incorrect. Screenshot 2019-09-12 at 6 30 00 PM Typescript project is created inside template directory.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
eugenemleecommented, Sep 13, 2019

IMPORTANT STEP: Remove your globally installed react-native-cli: npm uninstall -g react-native-cli

Then install using npx: npx react-native init app --template react-native-template-typescript

0reactions
ivanbtrujillocommented, Oct 12, 2019

@ajaymore use yarn react-native run-android or create a script in package.json

With npx:

npx react-native run-android 
Read more comments on GitHub >

github_iconTop Results From Across the Web

can not run `npx react-native init MyApp --template ... - GitHub
I uninstalled the react-native-cl and tried several different way to execute the npx call. Is there another way to get a new project...
Read more >
npx react-native init creates app with wrong version of React ...
Solved by changing this: npx react-native init MyApp --template react-native-template-typescript@6.5.* to this npx react-native init MyApp ...
Read more >
react-native-template-typescript - npm
Clean and minimalist React Native template for a quick start with TypeScript.. Latest version: 6.12.6, last published: 8 days ago.
Read more >
Setting up the development environment - React Native
This page will help you install and build your first React Native app. ... If you have a problem with Expo, before creating...
Read more >
Create an interactive React Native template
You can easily use a template to create your app with the React ... npx react-native init MyApp --template react-native-template-typescript.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found