'create-react-app hangs when initializing an app

It's my first time trying to use it, but after executing:

create-react-app myproject

I get:

Creating a new React app in C:\project

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

[  ................] \ fetchMetadata: sill resolveWithNewModule [email protected]

And it just hangs there forever.

I'm using npm 5.6.0 and create-react-app 2.0.3 on Windows 8.



Solution 1:[1]

I had this problem, mine got stuck at

Creating a new React app in C:\project

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

[  ................] \ fetchMetadata: sill resolveWithNewModule [email protected]

The solution for me was to ensure npm is up to date by running:

npm install npm@latest -g

After this, create-react-app worked correctly.

Solution 2:[2]

What I just did is press ctrl + C. My intention is to abort the process, but turns out the process is continue. Still not know any further logical explanation of the 'solution' that I just did, though.

Solution 3:[3]

If you get stuck while running create-react-app, just Ctrl + C to end the process in the terminal or CMD.

Then end task "node.exe" from task manager (if you use windows).

Then run in your terminal:

  • npm install npm@latest -g
  • npm install create-react-app -g
  • npx create-react-app (your-project-name)
  • cd (your-project-name)
  • npm start (inside your code editor, e.g. VSCode)

Note: beware of npm vs npx in the commands used above

Solution 4:[4]

Re-install Node js 32 bit.

My problem got fixed and same issue was there. Solution is to uninstall Node js and reinstall 32 bit Node js.....Enjoy Thanks

Solution 5:[5]

I was having the same problem, what i did is to run the command in nodejs command prompt instead of command prompt. it worked for me

Solution 6:[6]

Open a new terminal/CMD, type resmon and hit enter. Go to overview tab and search for cmd.exe (for windows users), straight to that, search for suspended. Yes this is the culprit. Right click on that suspended, and click 'resume process' and hit enter. Click continue if any pop-up occurs :). That's it you are done. you will see that your installation will continue :). Repeat the same process if CMD hangs.

Solution 7:[7]

adding nodejs path in User Variable worked for me.

Solution 8:[8]

Since you have npm 5.6.0, let try using npx

Open cmd:

Locate to you C:\project

C:
cd C:\project

Run npx and start the sample project with npm:

npx create-react-app myproject
cd myproject
npm start

npx come out since npm 5.2, and just read the document from create-react-app here

Solution 9:[9]

Try this; it worked for me:

npm install -g create-react-app

then run your command.

Solution 10:[10]

Just use parameter end of function print()

print(something,end="")

Solution 11:[11]

the prints everything in the list,

list = [("hi", "bye", "tree"), ("bye", "hi", "tree")]


for ind, elem in enumerate(list):
    for j in range(len(list[ind])):
        print(elem[j])

result:

hi bye tree bye hi tree

Solution 12:[12]

lst = [("hi", "bye", "tree"), ("bye", "hi", "tree")]
print(*(''.join(item) for item in lst), sep='\n')

Explanation

''.join() joins the given items, in your case, the elements of the passed tuples with the empty string '', effectively concatenating them.

*(''.join(item) for item in lst) runs all of this for each item of the outer list. Each item is one of said tuples. The parentheses mean, that this is a generator expression, which is immediately unpacked with the asterisk *. This means that each of the resulting elements will be passed as a positional argument to print().

Each of those items are printed, separated by the string specified by the keyword argument sep, which defaults to ' ', i.e. space. Since you want all of it on a separate line, we use the newline character '\n' instead.

An equivalent functional alternative using the built-in map() would be:

lst = [("hi", "bye", "tree"), ("bye", "hi", "tree")]
print(*map(''.join, lst), sep='\n')