Expo CLI未被认可

发布于 2025-02-08 13:26:51 字数 403 浏览 2 评论 0原文

我试图创建一个新的React-Native应用程序并创建它,我需要CLI,因此我通过NPM安装了它,但是在尝试运行EXPO INIT之后。...错误响应均为以下内容:

EXPO:expo:术语'' Expo'不被认为是CMDLET,功能,脚本文件或可操作程序的名称。检查名称的拼写,或者如果包括路径,请验证该路径是否正确,然后重试。 在线:1个char:1

  • 世博int _______
  •   + categoryInfo:objectNotFound :( expo:string)[],commandnotfoundexception
      +完全QualifiedErrid:CommandnotFoundException
    
     

感谢任何帮助,谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

红玫瑰 2025-02-15 13:26:52

如果您可以共享其他有用的屏幕截图。

一件事超级容易忽略的是路径。

例如,您

在该文件夹中创建一个新的文件夹“ myApp”,您运行npm install/expo init/etc。

这样做的是在该文件夹中创建另一个文件夹。

因此,您的新路径应为C:// PATH/MYAPP/MYAPP,

如果您使用屏幕截图/更多信息编辑问题,那么我可以给出一个更详细的答案。

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.

听不够的曲调 2025-02-15 13:26:52

我之前和这里有一些问题要尝试:

  • 在全球范围内安装Expo-CLI(您没有明确说明您已经完成了)npm I -G expo-cli
  • 如果您使用的是PowerShell,并且您沿着expo.ps1的线路获取消息无法加载,因为在此系统上禁用了脚本的执行。您需要启用脚本执行。确定所需的脚本执行范围。选择是限制的(如果您收到此消息,当前设置),allsigned无限制远程设计(可能是您想要的)。然后打开PowerShell作为管理员并运行
      set-execution-execution-policy remoteSign
     
  • 确保将NPM添加到路径(在Windows上寻找%userProfile%\ AppData \ roaming \ roaming \ npm
  • 经典卸载,重新启动和重新安装

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文