npm install -g create-react-app
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
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/legend/.npm/_logs/2020-05-04T08_45_14_806Z-debug.log
Asked
Active
Viewed 1.4k times
4

David Buck
- 3,752
- 35
- 31
- 35

Yaman Raj Mishra
- 51
- 1
- 1
- 2
-
this looks like permission error, you are about to install global instance of npm module on folder where you do not have permission, you can use sudo for it. – vaske May 04 '20 at 09:05
1 Answers
8
You need admin permissions for installing a module globally, run the command with sudo:
sudo npm install -g create-react-app

paltaa
- 2,985
- 13
- 28
-
1This work for me with the angular/cli. Any global (-g) install by node needs the sudo command. – Sterling Diaz May 06 '22 at 22:20