After running npm install -g expo-cli and successfully installing the packages globally, expo is still not recognized as an internal or external command. Does anyone know how I might get around this issue using windows 10, or what to do in terms of something like a path variable.
I may be too late to answer this, but for people looking for the same error this is what worked for me.
Install
yarnif you don't have it. I used the commandchoco install yarn(you'll have to install Chocolatey). If you have scoop installed,scoop install yarnalso works.Use
yarnto installexpowithyarn global add expo-cli.expo startshould work now.yarn startandnpm startshould also work.
Hope that helps!
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 with this content (without /node_modules ):
%USERPROFILE%\AppData\Roaming\npm
- Open a new command prompt and enter
> expo
Added These path of npm like this i have the same issue i fix it by adding the path to environment system
C:\Users\abobakr\AppData\Roaming\npm
After that close CMD and open it again it should work believe me
I had the same problem last night, and I've recently started my journey in ReactNative. So, there might be better answers out there.
If you're following the ReactNative Official documentation, the first time npm start works fine, the subsequent ones throws an error saying expo is not recognized. I got around that by running expo start and not npm start ( which basically is the same thing but doesn't work for some reason ).
So, mine looks like a work around rather than an explanation as to why this happens or how to permanently fix it.
this worked for me
1 you must unistall node js then install it again 2 you must run npm install expo-cli it will solve your problem
This is a more general problem where your global node modules are not in your system path. This question is what you are looking for: Nodejs cannot find installed module on Windows?
I have fixed this in Windows 10 by setting Path C:\Users\[USERNAME] this line save my hrs
For me, i uninstalled node.js,
i re-installed node.js,
i ran npm install -g expo-cli,
then ran expo --version (the expo command began to work).
Hope this helps.
来源:https://stackoverflow.com/questions/52731872/expo-is-not-recognized-as-an-internal-or-external-command
