defne yazicioglu
defne yazicioglu

Reputation: 61

npm create-react-app Error: EACCES: permission denied. The operation was rejected by your operating system

I want to use react in vscode but when I try to install node.js it gives me errors. my command is

npm install -g create-react-app
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/create-react-app/index.js
npm ERR! dest /usr/local/bin/create-react-app
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'
npm ERR!  [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'] {
npm ERR!   cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'] {
npm ERR!     errno: -13,
npm ERR!     code: 'EACCES',
npm ERR!     syscall: 'symlink',
npm ERR!     path: '../lib/node_modules/create-react-app/index.js',
npm ERR!     dest: '/usr/local/bin/create-react-app'
npm ERR!   },
npm ERR!   stack: "Error: EACCES: permission denied, symlink '../lib/node_modules/create-react-app/index.js' -> '/usr/local/bin/create-react-app'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/create-react-app/index.js',
npm ERR!   dest: '/usr/local/bin/create-react-app'
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!     /Users/defneyazicioglu/.npm/_logs/2020-03-23T17_10_48_130Z-debug.log

How can I solve this

Upvotes: 3

Views: 5362

Answers (1)

Fahd Rahali
Fahd Rahali

Reputation: 571

Try these commands :

  1. $sudo -s
  2. $npm install -g create-react-app
  3. $exit
  4. $npx create-react-app my-app

Upvotes: 3

Related Questions