'npm install -g create-react-app' throwing tons of errors

I’m currently working through this article (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 losing my mind trying to set up the first step. When I try to run ‘npm install -g create-react-app’ I get tons of error messages:

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.
npm ERR! A complete log of this run can be found in:

What is the problem and how do I get around it?

:pray: :pray: :pray:


Maybe you already have it?

Try running create-react-app <name-of-app> where is whatever name you want to give your app. Then run the ls command and see if you can find the folder you just created. cd into that folder and npm start to get it running!

When I do that I get this response:

syntax error near unexpected token `newline’

That’s strange, that’s usually coming from some previous error, can you try again and screenshot your process?

Try running npx create-react-app newapp


Yes! This worked. THAANKK YOUUU


No problem! Welcome to the forums! Enjoy react :slight_smile:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.