0

I want to create a new react-native project using this command in the terminal of visual studio :

npx react-native init project-name

But the terminal freezes for 10 minutes in this line

⸨⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠇ rollbackFailedOptional: verb npm-session e582ffa365b35dcf

Screenshot

enter image description here

I've tried these solutions but none of them worked for me.

When I tried npx create-react-app teachat, it worked very well. I got confused if the problem is related to npm or react-native.

2 Answers2

0

For these reasons it could occure.

1.network connectivity: some times your internet connection is okay but some applications may interfere when downloading dependency. In this case, try using a different network.

  1. Try removing react-native-cli from global installation with this npm uninstall -g react-native-cli

3.Try different version or typescript template npx react-native init projectname --version X.XX.X or npx react-native init AwesomeTSProject --template react-native-template-typescript

jessanKhan7
  • 3
  • 1
  • 4
0

The react native cli is a deprecated method of creating react native projects,the init method is the one currently in use. Check under Creating a new application the official docs

Uninstall react-native-cli and use the same command as you did npx react-native init projectname

web_walkerX
  • 840
  • 10
  • 19