无法在Android模拟器上运行react-native应用程序,因为'C:/ User / firstname'未识别为内部或外部命令

Ali Azlan |

我在一个终端上运行“ npx react-native start”并等待其启动应用程序,然后在另一终端上运行“ npx react-native run-android”以启动应用程序,但收到此错误...任何解决方案吗?我认为我的用户名的名字和姓氏(确定计算机)之间的空格可能会引起麻烦,但是我该如何解决。

屏幕截图错误

Ali Azlan |

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. my some apps stopped working after doing that so I had to reinstall them.
  2. don't forget to create restore point to restore to previous condition if u run into some problem.
  3. I didn't check all the appearance of my username by pressing f3 and following stuff again and again(it will took forever), I just exported registry editor and opened the exported file with sublime text editor searched for my old username and replaced all username at once by clicking of "find and replace all" and saved that registry files, but I took care of some technical things which I can't tell exactly here, otherwise I would run into problems. well after changing username I imported that changed registry editor file back into registry editor, it said it is erroneous but I ignored that and just restarted computer and followed remaining steps and it worked fine after then.
  4. 我建议如果您仅是位计算机天才,那么尝试调整注册表,否则只是寻求其他解决方案,这可能是重新安装Windows并设置一次命名的用户名

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章