无法在 android 模拟器上运行 react-native 应用程序,因为“C:/User/firstname"未被识别为内部或外部命令 [英] Unable to run react-native app on android emulator because 'C:/User/firstname' is not recognized as internal or external command

查看:65
本文介绍了无法在 android 模拟器上运行 react-native 应用程序,因为“C:/User/firstname"未被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个终端上运行npx react-native start"并等待它启动应用程序,然后在另一个终端上运行npx react-native run-android"以启动应用程序但收到此错误...任何解决方案请LZ?我认为我的用户名的名字和姓氏(OK 计算机)之间的空格可能会引起大惊小怪,但我该如何解决.

I am running 'npx react-native start' on one terminal and waiting for it to start app and then running 'npx react-native run-android' on other terminal to start app but receiving this error... any solution plz? i think may the white space between firstname and lastname(OK Computers) of my username is creating fuss but how can i resolve it.

推荐答案

只是我的电脑名称由两个用空格隔开的词组成(例如:Ali Azlan"空格 btw Ali 和 Azlan 会产生问题,我不知道 npx 为什么以及如何工作,但它只适用于单一名称(中间没有空格).所以我使用这些说明将我的计算机名称更改为单一名称,即 Ali Windows 10 - 带有空格和路径的用户名按照该链接上最长的答案.但在这样做之前请阅读以下注意事项,

Simply my computer name consisted of two words separated by a white space(for example: "Ali Azlan" the white space btw Ali and Azlan will create problem, I don't know why and how npx works but it only works with single name(no whitespace between). So I changed name of my computer to single name i.e Ali using these instructions Windows 10 - Username with whitespace and PATH follow the longest answer on that link. but reading cautions below before doing so,

  1. 这样做后,我的一些应用程序停止工作,因此我不得不重新安装它们.
  2. 如果遇到问题,请不要忘记创建还原点以恢复到以前的状态.
  3. 我没有通过按 f3 和一次又一次的跟踪来检查我的用户名的所有外观(这将花费很长时间),我只是导出了注册表编辑器并使用 sublime 文本编辑器打开了导出的文件,搜索了我的旧用户名和通过单击查找并替换全部"一次替换所有用户名并保存了该注册表文件,但我处理了一些我无法在这里确切说明的技术问题,否则我会遇到问题.更改用户名后,我将更改后的注册表编辑器文件重新导入注册表编辑器,它说这是错误的,但我忽略了这一点,只是重新启动了计算机并按照剩余的步骤进行操作,之后它工作正常.
  4. 如果你有点计算机天才,我会建议你尝试调整注册表,否则就去寻找其他解决方案,这可能是重新安装 Windows 并设置单一命名的用户名这次

这篇关于无法在 android 模拟器上运行 react-native 应用程序,因为“C:/User/firstname"未被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆