Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Stephen Benner
Stephen Benner
4,551 Points

Getting Error "Missing write access to /usr/local/lib/node_modules"

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' }

1 Answer

I'm probably too late with this answer, encountered the same issue myself, and decided to share here in case someone else runs into it in the future.

So, if you are having issues installing npm packages globally - you might have installed some packages using sudo, so first fix permissions by running following command:

sudo chown -R $USER /usr/local Note: do not replace the $USER with your username use the command as is.

Now, try to install the package you wanted globally.

Thank you Mira Hummingbird for the help it worked!!!!!!!!!!!