react-native: Init project hangs forever
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?
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 9
- Comments: 60 (16 by maintainers)
Commits related to this issue
- Add --verbose option (fixes #2797) — committed to winterbe/react-native by winterbe 9 years ago
- Merge pull request #3193 from winterbe/issue2797 Add --verbose option to react-native-cli (fixes #2797) — committed to facebook/react-native by mkonicek 9 years ago
- Add --verbose option (fixes #2797) — committed to facebook/react-native by winterbe 9 years ago
- Adding http as failover for react-tools git repo. Summary: Fixes #2797 for me. Most times git://github.com/facebook/react-tools times out. So adding http as a fail-over so that if git protocol doesn... — committed to facebook/react-native by knightsamar 9 years ago
- Add --verbose option (fixes #2797) — committed to skillz/react-native by winterbe 9 years ago
- Adding http as failover for react-tools git repo. Summary: Fixes #2797 for me. Most times git://github.com/facebook/react-tools times out. So adding http as a fail-over so that if git protocol doesn... — committed to skillz/react-native by knightsamar 9 years ago
- Add --verbose option (fixes #2797) — committed to Crash--/react-native by winterbe 9 years ago
- Adding http as failover for react-tools git repo. Summary: Fixes #2797 for me. Most times git://github.com/facebook/react-tools times out. So adding http as a fail-over so that if git protocol doesn... — committed to Crash--/react-native by knightsamar 9 years ago
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:For reference @MichaelBurgess suggests doing this (should save you a click) and that suggestion worked for me
references
if you from China, do this:
Registry has beensetto: http://registry.npm.taobao.org/
very very very … very fast
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.
@jeizsm check my SO post here, in case that helps.
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.
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.
I run --verbose, and it halts with this message:
How come it doesn’t install this as supposed to?
Edit: this problem was solved by running @MichaelBurgess suggestion above 😃
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).@captain-miao 厉害了,我的哥
@MichaelBurgess i have same problem but on windows 8. any solution ? Thanks
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 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
thanks --verbose works 😃
reinstall nodejs fix my issue 😃
I also encountered this issue and it’s root cause was also a previous aborted
brew install
attempt as described by @johngoren. Specifically, I ransudo brew install watchman
in a misunderstanding with Xcode having not installed correctly.brew
cowardly aborted the install, hence the error. Runningbrew doctor
did the trick.We actually decided to hide the output from
npm install
in https://github.com/facebook/react-native/commit/2ddf3d942dc080264bf5f17c1381e7e5f39e2f4fHappy to review a pull request that adds the output back under a
--verbose
option.Happening for me too.
Hi @winterbe I had the same issue , I don’t know why is it taking so long to init, what’s the root cause?