Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native init hangs/stalls with no error

New to react, working through a udemy tutorial on a Mac. Installed node ok but when I go to start a project

react-native init projectname

terminal output:

This will walk you through creating a new React Native project in /Users/myuserid/projects/projectname Installing react-native package from npm...

and it just "hangs" there... seemingly frozen or chugging along. When I check Monitor it looks like Terminal is using 0% CPU. There is no indication (backslash flipping or otherwise) that it is processing.

Inside the projectname directory is a "package.json" file and a "node_modules" file with a bunch of subfiles.

I saw this post with a similar problem (https://github.com/facebook/react-native/issues/2806), but doesn't look like there is a remedy. Is there any way to speed this up? How can I tell if it has stalled forever? Will this happen during every project init I do?

I'm not in China... I have fast internet... and I'm using NPM 3.3.12

Thank you!

like image 866
sthoward Avatar asked Sep 26 '22 17:09

sthoward


1 Answers

I got the same issue , and i found the 1st comment on the question is useful .

Indeed , If no error, it means that it takes time to download dependencies.

You can track downloading by adding --verbose :

react-native init projectname --verbose

You will spend a long period to reach 50% of downloading.


Nevertheless, you might face the following error :

npm WARN [email protected] requires a peer of react@~15.3.1 but none was installed. npm verb exit [ 0, true ]

If so , check this thread .

like image 131
Abdennour TOUMI Avatar answered Sep 28 '22 22:09

Abdennour TOUMI