UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript
See original GitHub issueref https://github.com/facebook/react-native/issues/29411
Description
I am trying to start a new project with typescript template and it’s failing on the step Removing module react-native-template-react-native-template-typescript...
with error error This module isn't specified in a package.json file.
, followed by this error UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript
.
This is the command I am running:
npx react-native init MyAwesomeApp --template react-native-template-typescript
React Native version:
0.63
Steps To Reproduce
- run
npx react-native init MyAwesomeApp --template react-native-template-typescript
- watch it fails
Expected Results
Successfully creates a new RN project
Snack, code example, screenshot, or link to a repository:
Full stack trace:
[1/4] 🔍 Resolving packages...
warning jest > @jest/core > jest-config > jest-environment-jsdom > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
error An unexpected error occurred: "https://registry.yarnpkg.com/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 "/path/to/project/MyAwesomeApp/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
yarn remove v1.22.4
[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:68507) UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript
at makeError (/path/to/project/MyAwesomeApp/node_modules/execa/index.js:174:9)
at /path/to/project/MyAwesomeApp/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async createFromRemoteTemplate (/path/to/project/MyAwesomeApp/node_modules/@react-native-community/cli/build/tools/generator/templates.js:115:5)
at async createProjectFromTemplate (/path/to/project/MyAwesomeApp/node_modules/@react-native-community/cli/build/tools/generator/templates.js:88:3)
at async generateProject (/path/to/project/MyAwesomeApp/node_modules/@react-native-community/cli/build/commands/init/initCompat.js:118:3)
at async Object.initCompat (/path/to/project/MyAwesomeApp/node_modules/@react-native-community/cli/build/commands/init/initCompat.js:105:3)
(node:68507) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:68507) [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.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
UnhandledPromiseRejectionWar...
UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript #29411.
Read more >Error: Command failed: yarn add react-native@latest
I've been trying to start a new React Native project but have been facing this issue for a few days, tried searching for...
Read more >Error Codes | Yarn - Package Manager
This error means that this process failed and Yarn cannot successfully figure out which version of the package should be added to your...
Read more >Strange build error with yarn add - beginner - ReScript Forum
❯ yarn build yarn run v1.22.19 $ rescript /bin/sh: rescript: command not found error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/ ......
Read more >141.0 yarn broke node.js deployment [35907771] - Issue Tracker
(node:22046) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Command failed with exit code 1
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You may have installed it by accident. Try
npx react-native@0.63 init
ornpx @react-native-community/cli init
which will also work.@jgcmarins @DevHabit it’s apparent you have a globale
react-native
binary installed, (react-native-cli
module), which you should remove. Please make sure to runnpm uninstall -g remove react-native react-native-cli
and same for Yarn. Check some older Node versions or caches. Runningwhich react-native
shouldn’t return anything. Then you can run:as official RN docs advise: https://reactnative.dev/docs/typescript