For a long time now, it has been impossible for me to initialize a react project, or even to initialize a project with npm because of multiple errors that I cannot resolve. Initially, it started from my versions of npm and node js that I had to update. I uninstalled create-react-app globally and then I reinstalled it. But when I launch the creation of a react project with create react app I have the following errors
glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/root/.npm/_logs'
}
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /root/.npm/_cacache/tmp
npm ERR! errno -13
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 1000:1000 "/root/.npm"
Creating a new React app in /home/tiffane/Documents/Visi/client.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/root/.npm/_logs'
}
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /root/.npm/_cacache/tmp
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 1000:1000 "/root/.npm"
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra- template has failed.
Deleting generated file... package.json
Deleting client/ from /home/tiffane/Documents/Visi
Done.
after reading the errors obtained I performed an npm cache clean --force history to clean things up, I tried to initialize react in root mode, I entered the command sudo chown -R 1000: 1000 "/ root /.npm "as indicated, but nothing to do I still can not initialize my project react