Expo gets stuck during install with npm but installs with yarn and doesn't work

Viewed 2541

When I try installing expo using npm install -g expo-cli, it gets stuck for hours here - expo-cli error

npm WARN deprecated @hapi/joi@17.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411) [..................] \ fetchMetadata: WARN deprecated @hapi/joi@17.1.1: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/

But when I use yarn to install expo, it says expo is installed successfully. But it doesn't work when I type expo --version or just expo in cmd.

I've tried changing the environment path I've uninstalled and reinstalled node I've tried npm cache clean --force

2 Answers

npm install --global expo-cli --force

That's what did it for me. Same errors at the beginning of the installation attempt, but afterwards it ignored the issues and installed it anyways. And it works just fine. Though, usually you should be careful with " --force".

I had this problem in Windows 10, to be able to install the latest version. I had to install the latest version of Python (3.8.0) and then run npm install --global --production windows-build-tools as an administrator, then I was able to run again: npm install expo-cli --global to install the version 3.8.0 of the expo-cli

Related