React command line tools not installing


#1

Hey guys! Im trying to install the React command line tools with this command “npm install -g create-react-app”. As my CodeCademy intensive course is instructing me to do. Unfortunately it is giving me an error which inhibits me from continuing the course…

This is the error message i recieve in my “Bash”. (Im on a Mac computer btw.)

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
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! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Berglund/.npm/_logs/2017-12-12T15_15_46_943Z-debug.log

Super thankful for any help in resolving this issue!
Best regards, Einar Berglund.


#2

What privileges did you use in an attempt to install? It might be that you need root privileges


#3

Thanks for the quick response! How do i know which privileges I used? I did not configure anything, i just ran that command as instructed.


#4

that depends on the command you ran, what command did you run?

if you ran the command without sudo (superuser do), you have normal user privileges of your Berglund user account, which seems not to have permission to write to /usr/local/lib/node_modules directory


#5

Massive thank you! That solved the issue


#6

not important that the issue is ‘solved’, its much more important you understand the environment, understand what permissions are and so on


#7

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