'expo' is not recognized as an internal or external command

允我心安 提交于 2019-12-05 01:59:58

I may be too late to answer this, but for people looking for the same error this is what worked for me.

  1. Install yarn if you don't have it. I used the command choco install yarn (you'll have to install Chocolatey). If you have scoop installed, scoop install yarn also works.

  2. Use yarn to install expo with yarn global add expo-cli.

  3. expo start should work now. yarn start and npm start should also work.

Hope that helps!

For Windows 10, you can simply add the npm folder to your path environment variable.

  1. Hit Windows key and search for Environment variables.
  2. Inside the Path variable under System variables, add a new entry with this content (without /node_modules ):

%USERPROFILE%\AppData\Roaming\npm

  1. Open a new command prompt and enter

> expo

You will see something like this:

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!