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.

can not run `npx react-native init MyApp --template react-native-template-typescript`

See original GitHub issue

Bug

Environment info

React native info output:

 // paste it here

Library version: x.x.x

Steps To Reproduce

Describe what you expected to happen:

Reproducible sample code

yarn add v1.17.3
[1/4] 🔍  Resolving packages...
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
error An unexpected error occurred: "https://registry.npmjs.org/react-native-template-react-native-template-typescript: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/kenny/react0611/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
yarn remove v1.17.3
[1/2] 🗑  Removing module react-native-template-react-native-template-typescript...
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command.
warn Failed to clean up template temp files in node_modules/react-native-template-react-native-template-typescript. This is not a critical error, you can work on your app.
(node:2599) UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript
    at makeError (/Users/kenny/react0611/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/Users/kenny/react0611/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:2599) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:2599) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
k

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:36 (6 by maintainers)

github_iconTop GitHub Comments

324reactions
PeterKowcommented, Sep 28, 2019

Just remember to npm uninstall -g react-native-cli and yarn global add @react-native-community/cli so you have new features during starting a new project

270reactions
emin93commented, Sep 30, 2019

Can you try adding the --ignore-existing flag?

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create App with React Native and typescript - Stack Overflow
To fix the issue try uninstalling the CLI: npm uninstall -g react-native-cli or yarn global remove react-native-cli and then run the npx command...
Read more >
react-native-template-typescript - npm
Start using react-native-template-typescript in your project by running `npm i react-native-template-typescript`. There are no other ...
Read more >
react-native-template-typescript - npm package - Snyk
Learn more about react-native-template-typescript: package health score, ... npx react-native init MyApp --template react-native-template-typescript ...
Read more >
Setting up the development environment - React Native
If they are not installed, you should expect to spend about an hour ... Expo Go allows you to run your React Native...
Read more >
not working npx react-native init MyApp - Code Grepper
There seems to be quite some confusion about the legacy CLI. This template only works with the new CLI. Make sure you have...
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