Home > Back-end >  Expo CLI not recognised
Expo CLI not recognised

Time:06-18

im trying to create a new react-native app and to create it i need the expo CLI so i installed it via npm but then after trying to run expo init.... an error response occrured as the following:

expo : The term 'expo' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • expo init _______
  •     CategoryInfo          : ObjectNotFound: (expo:String) [], CommandNotFoundException
        FullyQualifiedErrorId : CommandNotFoundException
    
    

Would apperciate any help, Thanks.

CodePudding user response:

If you could share additional screenshots that would be helpful.

One thing that is super easy to overlook is the path.

For example, you create a new folder "myApp"

Inside that folder you run npm install/expo init/etc.

What this does is creates another folder inside that one.

So your new path should be C://path/myApp/myApp

If you edit your question with screen shots/more info, then I can give a more detailed answer.

CodePudding user response:

I had this issue before and here are some things to try:

  • install expo-cli globally (you dont explicitly state you've done this) npm i -g expo-cli
  • If you are using PowerShell and you are getting messages along the line of expo.ps1 cannot load because the execution of scripts is disabled on this system. you need to enable script execution. Decide on the script execution scope you want. Choices are Restricted (the current setting if you are getting this message), AllSigned, Unrestricted, and RemoteSigned (probably the one you want). Then open PowerShell as an admin and run
    Set-ExecutionPolicy RemoteSign
    
  • Make sure npm is added to path (on Windows look for %USERPROFILE%\appData\Roaming\npm)
  • The classic uninstall, reboot, and reinstall
  • Related