Https://www.codecademy.com/paths/web-development/tracks/front-end-applications-with-react/modules/react-development-setup-and-ravenous-part-1/articles/how-to-create-a-react-app

I am following the instructions to install create-react-app in my Command Line Interface. When I enter the command:
npm install -g create-react-app

I get the following error messages which seem to do with the write access rights for /usr/local/lib/node_modules folder

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! errno: -13,

npm ERR! code: ‘EACCES’,

npm ERR! syscall: ‘access’,

npm ERR! path: ‘/usr/local/lib/node_modules’

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.

How do I fix this error?

https://www.codecademy.com/paths/web-development/tracks/front-end-applications-with-react/modules/react-development-setup-and-ravenous-part-1/articles/how-to-create-a-react-app

Hello, I had the same issue. It is due to admin permission on your comp.

First make sure you have both the latest node and npm installed. (go into thermal and type node -v and npm -v to check)

Open a new terminal. Follow steps 1 and 2 in the attached link (https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md)

Then run npm install -g create-react-app

This is what worked for me. I know you could run sudo npm install -g create-react-app but I have been told to avoid using the sudo command for npm install.

Hope this helps!