Create-react-app couldn't generate and has errors
I haven't code for a while and want to get back into it. When I tried to run: npx create-react-app my-app, this is what returned to me:
Creating a new React app in /Users/kyhongle/Desktop/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /Users/kyhongle/.npm/_cacache/content-v2/sha512/0b/62
npm ERR! errno -13
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 501:20 "/Users/kyhongle/.npm"
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/kyhongle/.npm/_logs/2020-03-18T21_14_29_829Z-debug.log
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from /Users/kyhongle/Desktop
I am not sure how to go from here. Before that I did something, probably shouldn't have, I ran a sudo npm cache clean -f. I think that could have been what causing this problem. If someone can help me reverse this, I would really appreciate it!