For me, I used yarn instead of npm.
yarn global add sharp
Then
yarn global add expo-cli
After that, if you run
expo
And got
expo is not a command
Which means you need to
add yarn global packages to the envirmonment variable. And your yarn global packages might in C:\Users\username\AppData\Local\Yarn\bin.
Also, I installed python 2.7 in the beginning. Not sure if it helps.
Answer from xianshenglu on Stack OverflowVideos
For me, I used yarn instead of npm.
yarn global add sharp
Then
yarn global add expo-cli
After that, if you run
expo
And got
expo is not a command
Which means you need to
add yarn global packages to the envirmonment variable. And your yarn global packages might in C:\Users\username\AppData\Local\Yarn\bin.
Also, I installed python 2.7 in the beginning. Not sure if it helps.
After wasting almost 1 day, I resolved this issue, this error is due to sharp
If you are having issues during installation consider removing the directory C:\Users[user]\AppData\Roaming\npm-cache_libvips
npm install -g sharp # (The installation require python 2.7 on windows and path env configuration)
npm install -g expo-cli
although this solution is not the best and the safest solution exists, this worked for me and that make sense because all the problem we had with the errors is the permission problems. so you can use this command and ignore those permission problems :
sudo npm install expo-cli -g --unsafe-perm
I was having the same problem with npm install -g expo-cli, having "MODULE_NOT_FOUND",
I installed yarm with brew, just in case you do not already have it:
brew install yarn
and then use:
yarn global add expo-cli
to create a project you can:
expo init nameOfTheNewProject
and choose a template in the console. Finally run the project with
yarn start
Let me know if it works for you!
I have the same problem. OS: Win 10. As I understood it's connected with [email protected] The problem was fixed in new version of envsub but expo-cli still uses 3.1.0
P.S.
3.5.0 works
npm install -g [email protected]
Do the following:
expo init
follow the prompt.
You can either chose to install with Yarn or npm.
It works for me.
Okay so after a bit of research and the error I got now it is clear that this is a problem from npm so I just installed react-native-cli instead of expo-cli and it worked.
thanks for the support.
npm install -g react-native-cli
react-native init AwesomeApp
cd AwesomeApp
npm start
Probably the only thing missing is to add the expo executable to your path.
For Windows 10, you can simply add the npm folder to your path environment variable.
- Hit Windows key and search for
Environment variables. - Inside the Path variable under
System variables, add a new entry (entries are separated by semicolons) with this content (without /node_modules ):
%USERPROFILE%\AppData\Roaming\npm
OR if you are using yarn C:\Users\{USER}\AppData\Local\Yarn\bin (as @Qwerty mentioned above)
- Open a new command prompt and enter
> expo
You will see something like this:
I wondered it was working last night when I first installed and run the "react-native" project but the very next day it showed me the same error as yours.
Here is what I did in windows 10 Operating System:
Add the following path :
environment variable > System Variables > PATH > C:\Users\YOUR_USERNAME\AppData\Roaming\npm
Now I ran the following commands one by one in CMD:
i) npm -g uninstall expo-cli --save
ii) npm install -g expo-cli
Now start the Project and run npm start and now it works for me.
I didn't try this article one but it also shows the solution for the same problem, see here