简体   繁体   中英

Unable to run react-native app on android emulator because 'C:/User/firstname' is not recognized as internal or external command

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.

错误截图

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 ie 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. I would recommend if ura bit computer genius only then try to tweak registry else just go for some other solution which may be is to reinstall windows and set single named username this time

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM