Permission error creating my REACT project

Viewed 28

I try to give the command npx create-react-app crud-book-management but it gives the following error:

npm ERR! code EPERM
npm ERR! syscall symlink
npm ERR! path ../@babel/parser/bin/babel-parser.js
npm ERR! dest /media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/crud-boo-management/node_modules/.bin/parser
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, symlink '../@babel/parser/bin/babel-parser.js' -> '/media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/crud-boo-management/node_modules/.bin/parser'
npm ERR!  [Error: EPERM: operation not permitted, symlink '../@babel/parser/bin/babel-parser.js' -> '/media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/crud-boo-management/node_modules/.bin/parser'] {
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../@babel/parser/bin/babel-parser.js',
npm ERR!   dest: '/media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/crud-boo-management/node_modules/.bin/parser'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/marcius/.npm/_logs/2022-08-31T15_45_59_824Z-debug-0.log

if I try to run it with sudo it says that the npm command was not found, I believe it is not right for me to run create with sudo as well.

I always get lost with npm, does anyone know what I'm doing wrong, and how do I fix it?

UPDATE

I'm try this:

sudo npm install -g create-react-app

this was my exit:

npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

added 67 packages, and audited 68 packages in 2s

4 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

however when running the command npx create-react-app crud-book-management I had the same error, I tried to add --no-bin-links, and gave the following error:

Creating a new React app in /media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/crud-book-management.


Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...



Aborting installation.
  npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts@0.9.x has failed.

Deleting generated file... package.json
Deleting crud-book-management/ from /media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management
Done.

I tried running sudo npm install --no-audit --save --save-exact --loglevel error react react-dom react-scripts@0.9.x has failed. and:

npm ERR! code EPERM
npm ERR! syscall symlink
npm ERR! path ../acorn/bin/acorn
npm ERR! dest /media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/node_modules/.bin/acorn
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, symlink '../acorn/bin/acorn' -> '/media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/node_modules/.bin/acorn'
npm ERR!  [Error: EPERM: operation not permitted, symlink '../acorn/bin/acorn' -> '/media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/node_modules/.bin/acorn'] {
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../acorn/bin/acorn',
npm ERR!   dest: '/media/marcius/GERAL/SENAC/PSEL/Aula 00 - CRUD em React/crud-book-management/node_modules/.bin/acorn'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-08-31T16_49_12_715Z-debug-0.log
0 Answers
Related