Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init project hangs forever #2797

Closed
winterbe opened this issue Sep 17, 2015 · 60 comments
Closed

Init project hangs forever #2797

winterbe opened this issue Sep 17, 2015 · 60 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@winterbe
Copy link
Contributor

I cannot create a new react-native project any more (worked yesterday). The init command hangs forever in this state:

$ react-native init MyProject
This will walk you through creating a new React Native project in /Users/.../Projects/MyProject
\

The directory MyProject gets created with a single file package.json with the following content:

{"name":"MyProject","version":"0.0.1","private":true,"scripts":{"start":"node_modules/react-native/packager/packager.sh"}}

The slash/backslash is still flipping but no matter how long I wait, nothing happens. Connection to NPM is working generally, e.g. I'm able to install new packages, so my internet connection should be fine.

I tried with Node 4.0.0 as well as latest Node 4.1.0 and NPM 2.14.3.

I'm curious because yesterday everything worked like a charm, so I guess my general config is fine.

Any help?

@winterbe
Copy link
Contributor Author

Hm, after a couple of retries and after waiting a huge amount of time, the project is finally created.

@jarnanchen
Copy link

Hi @winterbe I had the same issue , I don't know why is it taking so long to init, what's the root cause?

@winterbe
Copy link
Contributor Author

I really don't know what causes this issue. It took like 10 min until some logs get printed and the command succeeded. Is there some kind of -verbose mode for react-native-cli? That would be handy in those situations.

Am 17.09.2015 um 17:28 schrieb Jr notifications@github.com:

Hi @winterbe I had the same issue , I don't know why is it taking so long to init, what's the root cause?


Reply to this email directly or view it on GitHub.

@pandurangnayak
Copy link

I get the same problem. I let it run for hours and it still hadn't gone beyond the one file and the same line mentioned above by @winterbe.

I am on node v4.0.0 and npm v2.14.2.

@winterbe
Copy link
Contributor Author

I first thought that it was a local problem on my machine/ network but it seems more and more people have the same problem.

So I reopen the issue now in hope that someone finds out the root cause of the problem.

@winterbe winterbe reopened this Sep 19, 2015
@behl1
Copy link

behl1 commented Sep 21, 2015

+1

@johngoren
Copy link

Happening for me too.

@iSimar
Copy link

iSimar commented Sep 27, 2015

Same problem here, I have to keep trying to get it to complete and build.
Has anyone found a solution?

@johngoren
Copy link

It's weird, it only happened to me on a MacBook where I had made some aborted early attempts to brew install, and hadn't done the updating and symlinking right and had to fix permissions prior to running the command line tool.

On my desktop Mac, when I brew updated first, it ran much smoother (and there weren't any symlink or permissions issues)

@RxDx
Copy link

RxDx commented Sep 28, 2015

+1

@erg
Copy link

erg commented Sep 28, 2015

Something is definitely taking too long, but it works after 10 minutes on my late 2012 macbook pro. I was about to give up but it kept spinning.

node --version
v4.1.1

@swastik
Copy link

swastik commented Sep 29, 2015

It downloads about ~73mb of data and does that very slowly, but once it is downloaded, it goes through just fine. You can use something that monitors the git process to see where it's at.

@iSimar
Copy link

iSimar commented Sep 29, 2015

@swastik how would you monitor the git process?

@johngoren
Copy link

Wish there were more verbose messages on what was happening.

@swastik
Copy link

swastik commented Sep 29, 2015

@iSimar — On a Mac, open Activity Monitor, go to the 'Network' tab, and you'll see it there.

@piyushtiwari
Copy link

I am facing the same problem.

@mkonicek
Copy link
Contributor

mkonicek commented Oct 1, 2015

We actually decided to hide the output from npm install in 2ddf3d9

Happy to review a pull request that adds the output back under a --verbose option.

@ivks
Copy link

ivks commented Oct 2, 2015

+1
Location: kolkata, India

@winterbe
Copy link
Contributor Author

winterbe commented Oct 2, 2015

@mkonicek I'll be looking into it.

@winterbe
Copy link
Contributor Author

winterbe commented Oct 2, 2015

@mkonicek Submitted PR: #3193

mkonicek added a commit that referenced this issue Oct 5, 2015
Add --verbose option to react-native-cli (fixes #2797)
@winterbe
Copy link
Contributor Author

winterbe commented Oct 5, 2015

To everyone having problems with project creation:

With next version of React Native CLI you can use --verbose option to get a clue what's going on:

react-native init MyAwesomeProject --verbose

@mkonicek
Copy link
Contributor

mkonicek commented Oct 5, 2015

yay! 👍

@mkonicek
Copy link
Contributor

mkonicek commented Oct 5, 2015

Thanks for the PR @winterbe!

@winterbe
Copy link
Contributor Author

winterbe commented Oct 5, 2015

My pleasure! React native is awesome, keep up the great work every one!

@gengjiawen
Copy link
Contributor

When executing react-native init AwesomeProject --verbose, I get these:

This will walk you through creating a new React Native project in D:\Developer\FrontEnd\AwesomeProject
Installing react-native package from npm...
events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at exports._errnoException (util.js:856:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at _combinedTickCallback (node.js:377:13)
    at process._tickCallback (node.js:401:11)
    at Function.Module.runMain (module.js:449:11)
    at startup (node.js:141:18)
    at node.js:933:3

node version: v5.7.1
os: win 10, x64
npm: 3.6.0
@mkonicek Any suggestion, thanks.

@gengjiawen
Copy link
Contributor

reinstall nodejs fix my issue :)

@Srinivas-Guni
Copy link

thanks --verbose works :)

@Geeshang
Copy link

The official doc Getting Started should add this "--verbose", or this will make new user confused a lot.

@warpdesign
Copy link

@gengjiawen I am also getting this error when trying to append --verbose (because you know, react-native init fails and I'd like to know why). How did you fix your problem ?

Updating node didn't do it for me.

@gengjiawen
Copy link
Contributor

@warpdesign don't use upgrade.you need to uninstall the old version,then install the new version.

@SaladJack
Copy link

@captain-miao it works!!!

@edthedev
Copy link
Contributor

This takes way longer than is typical for a command line operation that gives no status.

It would be terrific to see a message "Downloading 73mb of data. This could take awhile. Use --verbose to watch progress." rather than having to surf the web to this ticket to understand what it is doing.

@jefe-spain
Copy link

Still having this problems, Installing RN0.33 with Node 6.50 npm 3.10.6

I don't know what do , been trying the last few days, diferent versions of RN without success. My internet connection is good and everything seems to be fine, just It doesn't install. Any way to install the package manually?

Thanks

@MichaelBurgess
Copy link

MichaelBurgess commented Oct 2, 2016

I am experiencing this problem as of today. I've reinstalled brew, node, watchman, react-native-cli and when I do a verbose install, it just gets stuck after all the npm packages have installed (of which react is not one):

npm WARN react-native@0.34.1 requires a peer of react@~15.3.1 but none was installed. npm verb npm verb If you need help, you may report this error at: npm verb <https://github.com/npm/npm/issues> npm verb exit [ 0, true ] npm info ok

It just sits there indefinitely. If I kill the process then all I have in my project folder is package.json and node_modules.

Any ideas?

EDIT This is the first project I have tried to create since upgrading to macOS Sierra a week or so ago. Could this be at fault? I can run and work on existing projects under Sierra FYI, just can't create new ones.

@jeizsm
Copy link

jeizsm commented Oct 4, 2016

@MichaelBurgess I have same problem, but also can't run existing project.
Mac OS Sierra, node 6.7.0, react-native-cli: 1.0.0, react-native: 0.34.1

@MichaelBurgess
Copy link

@jeizsm check my SO post here, in case that helps.

@jeizsm
Copy link

jeizsm commented Oct 4, 2016

@MichaelBurgess it helped, thanks

@spoko22
Copy link

spoko22 commented Oct 5, 2016

Something doesn't feel right with --verbose. I tried generating project both with and without --verbose flag. With - generating fails immediately. However - without the flag generator froze for a while, but project seems to be generated properly. I followed instructions from Getting Started guide (Windows 10, Chocolatey).

D:\Projekty\React>node -v
v6.7.0
D:\Projekty\React>npm -v
3.10.3
D:\Projekty\React>react-native init AwesomeProject --verbose
prompt: Directory AwesomeProject already exists. Continue?:  (no) yes
This will walk you through creating a new React Native project in D:\Projekty\React\AwesomeProject
Installing react-native package from npm...
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at exports._errnoException (util.js:1036:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

D:\Projekty\React>react-native init AwesomeProject
prompt: Directory AwesomeProject already exists. Continue?:  (no) yes
This will walk you through creating a new React Native project in D:\Projekty\React\AwesomeProject
Installing react-native package from npm...
Setting up new React Native app in D:\Projekty\React\AwesomeProject
AwesomeProject@0.0.1 D:\Projekty\React\AwesomeProject
`-- react@15.3.2

To run your app on iOS:
   cd D:\Projekty\React\AwesomeProject
   react-native run-ios
   - or -
   Open D:\Projekty\React\AwesomeProject\ios\AwesomeProject.xcodeproj in Xcode
   Hit the Run button
To run your app on Android:
   Have an Android emulator running (quickest way to get started), or a device connected
   cd D:\Projekty\React\AwesomeProject
   react-native run-android

@robbiemoore
Copy link

robbiemoore commented Oct 13, 2016

I run --verbose, and it halts with this message:

npm WARN react-native@0.35.0 requires a peer of react@~15.3.1 but none was installed.
npm verb exit [ 0, true ]
npm info ok

How come it doesn't install this as supposed to?

Edit: this problem was solved by running @MichaelBurgess suggestion above :)

@fourcolors
Copy link

For reference @MichaelBurgess suggests doing this (should save you a click) and that suggestion worked for me

rm -rf /usr/local/var/run/watchman/ && brew uninstall watchman && brew install watchman

references

@Piotrovskyi
Copy link

@MichaelBurgess it helped, thanks

@dennyrachmadi
Copy link

@MichaelBurgess i have same problem but on windows 8. any solution ? Thanks

@Timoses
Copy link

Timoses commented Oct 25, 2016

react-native init <project> --verbose:
Verbose mode should maybe only display warnings and errors. It's incredibly cumbersome to scan through all those "verb" and "info" entries...

@ghost
Copy link

ghost commented Oct 29, 2016

Looking through the verbose output, 151.101.40.162 keeps timing out.

@fakediulei
Copy link

@captain-miao 厉害了,我的哥

@realtebo
Copy link

realtebo commented Dec 31, 2016

I've this problem when try first run

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 23.0.1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
(node:4968) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'message' of undefined
(node:4968) 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.

Node: v7.2.1
npm: 4.0.5
Windows 10 Pro x64

@farskid
Copy link

farskid commented Jan 11, 2017

It's weird, I had been facing this issue when I realized I was trying to init a project called test and there was already a test folder inside the directory.

@itajenglish
Copy link

@fourcolors This worked for me! Your awesome dude 👍 Spend a day and half trying to figure it out.

@JasonHenson
Copy link

restarting multiple times got it to work for me.

@1c7
Copy link

1c7 commented Feb 20, 2017

@captain-miao soluation work for me, I am in China.

@pptyasar
Copy link

pptyasar commented Aug 4, 2017

Will anyone tell how to fix this??

@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests