I’m very very new on this, I must to use react for a homeork in Visual Code . I installed node.js but when I try to run npx create-react-app . it pop up an Error and I don’t know what I have to do to fixed. I tried unistall and install node.js several times, and the error still there.
user@users-MacBook-Air atest % npx create-react-app .
Creating a new React app in /Users/user/Documents/atest.
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/user/.npm/_cacache/index-v5/92/81
npm ERR! errno EACCES
npm ERR!
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!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 501:20 "/Users/user/.npm"
npm ERR! A complete log of this run can be found in: /Users/user/.npm/_logs/2024-04-25T09_18_07_410Z-debug-0.log
Aborting installation.
npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting atest/ from /Users/user/Documents
Done.
user@users-MacBook-Air atest %
I tried to change owner but there is another problem: I don’t have a password and when I run sudo chown -R 501:20 it ask me for a password…
Can someone help me to solve this, thanks!
I install and unistall node.js several times
I tried to use “sudo chown -R 501:20”
Shirly B. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.