Command gets stuck while installing expo-cli

Viewed 5482

I am trying to install expo-cli on Windows 10 OS for react native through npm install expo-cli --global command, but it gets stuck at this line.

enter image description here

  • I've tried clearing npm cache and reinstalling node.
  • I've tried running the command npm install expo-cli --global in powershell.
  • I've tried installing expo-cli through yarn, but it gets stuck on an error There appears to be trouble with your internet connection. Retrying... ,although I checked and my internet is working fine.

I'm not able to figure out how to resolve it.

6 Answers
  1. run npm cache verify
  2. run npm install expo-cli --global --no-optional

this worked for me. Also, consider using Powershell instead of cmd

Just wait and make sure the network connectivity is good. It took time for me too. Anything bash, cmd or powershell will do the job.

This might be due to wrong configuration of your node.

If you used home brew to install node.js, uninstall it and re-install node again using the package installer from the nodejs official website.

It worked for me.

This seems to be a problem with npm and your internet connection, sadly. The expo-cli package is quite large to install so any internet connectivity issues would become clear during the several minutes it may take on the first install. I would suggest trying it again on another internet connection if possible. If you do not think that this is the problem, you can try to build it from source at https://github.com/expo/expo-cli

For me what worked is:

  1. Start CMD as administrator
  2. Run npm cache verify
  3. Run npm install expo-cli --global --no-optional

Also, verify that you use the correct node version.

I was having this same issue! What ultimately worked for me was the following command:

npm install -g expo-cli --legacy-peer-deps

Related