After uninstalling the react-native-cli
i run this command to initiate a RN project with typescript template:
npx react-native init MyApp --template react-native-template-typescript
but i got this error:
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom
[email protected]: use String.prototype.padStart() 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 .....
[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:8548) UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript
Remove the legacy react-native-cli
npm uninstall -g react-native-cli
Install new one from "react-native-community":
npm i -g @react-native-community/cli
after that, init the Project with:
npx react-native init MyApp --template react-native-template-typescript
Resolved: i had to remove react native cli using yarn too
yarn remove global react-native-cli
This will also help, --ignore-existing
npx --ignore-existing react-native init MyApp --template react-native-template-typescript
Remove
npm uninstall -g react-native-cli
Create the folder where the project will be
mkdir [folder name] && cd [folder name]
Install the dependencies and everything will work
yarn init
yarn add react-native
yarn react-native init [Project Name] ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With